BALTIMORE -- Aaron Judge and Chase Headley hit two-run homers, Starlin Castro and Todd Frazier added solo shots and the New York Yankees beat the Baltimore Orioles 9-1 Thursday for their first series win at Camden Yards in four years.
Didi Gregorius had three hits and scored twice for the Yankees, who closed within 3 1/2 games of AL East-leading Boston and fortified their grip on the top AL wild card.
Sonny Gray (9-9) gave up one unearned run and six hits in 5 2/3 innings. The right-hander is 3-4 since he was acquired by New York in a July 31 trade with Oakland.
After rain postponed Wednesday night's game, the Yankees dominated the makeup from the outset. Judge connected in the first inning for a 3-0 lead, giving him 39 home runs -- second-most by a rookie in major league history behind Mark McGwire's 49 in 1987.
New York added two runs in the third against Kevin Gausman (10-10), and Headley's drive off Mike Wright made it 7-0 in the fourth.
By taking two out of three, the Yankees earned their first series win in Baltimore since Sept 9-13, 2013. The 11-series drought was the second-longest in franchise history, behind only a 12-series run in Oakland from 1985-91.
Castro homered in the sixth for an 8-0 lead, and Frazier went deep in the seventh to give every New York starter at least one hit.
After going 6-4 on their penultimate homestand, the Orioles head to Cleveland trailing Minnesota and Los Angeles for the final AL wild card.
Coming off two starts in which he didn't allow a run over 13 2/3 innings, Gausman gave up an RBI double to Gregorius in the first before Judge ripped a belt-high fastball deep into the center-field bleachers.
Gausman was lifted after yielding five runs in three innings. In five starts against New York this season, the right-hander is 1-2 with a 9.27 ERA.