NEW YORK — Gleyber Torres drove in two with a pinch-hit double with two outs in the eighth inning and the New York Yankees beat the Baltimore Orioles 3-1 Sunday to complete a pivotal four-game sweep.

The Yankees have won five straight and moved 5 1/2 games ahead of the Orioles for the eighth and final AL postseason spot. New York dropped three of four last weekend in Baltimore but outscored the O's 21-3 this weekend.

Dillon Tate (1-1) allowed singles by Aaron Hicks and Clint Frazier before Baltimore called on left-hander Tanner Scott. Torres hit for lefty-swinging Brett Gardner and roped a 1-0 pitch to the warning track in right-center field.

Baltimore lost its fifth straight after it had won six of eight to get back into the race. The Orioles also dropped their 10th straight game at Yankee Stadium.

Yankees left-hander J.A. Happ allowed one run and five hits in five innings. Baltimore's John Means turned in a second straight sharp outing, allowing a run and five hits over six innings to match his longest outing of the season.

Jonathan Holder stranded two in the sixth after Adam Ottavino issued a walk to Pedro Severino and allowed a single to Renato Núñez. It was Ottavino's first appearance since allowing six runs Monday to Toronto in Buffalo.

Chad Green and Zack Britton (1-2) pitched a hitless inning apiece, and Aroldis Chapman converted his second save.

The teams capitalized on the short porch in right field for early homers.

Núñez hit the first pitch of the second just over the right field wall for a 1-0 Baltimore lead. Núñez's 338-foot homer was his fifth off Happ.

Tyler Wade tied it with one out in the third on a 340-foot drive that landed a few rows into the right field seats.

CHAPMAN'S HEARING

Chapman's appeal of his three-game suspension for throwing a 101 mph fastball near the head of Tampa Bay's Michael Brosseau on Sept. 1 is scheduled for Monday, according to manager Aaron Boone. Chapman was disciplined after the pitch nearly sparked a brawl. He said he felt the discipline was a little harsh.

TRAINER'S ROOM

Orioles: OF Austin Hays (fractured rib) could return in the next few days. Hays has not played since Aug. 14 against Washington.

Yankees: RF Aaron Judge (strained right calf) took swings in the batting cage, ran the bases, ran in the outfield and did defensive drills. Judge, who has played once since Aug. 11 due to two injured list stints, could go the alternate site in Scranton-Wilkes/Barre on Monday. ... DH Giancarlo Stanton (strained left hamstring) ran the bases, took a few at-bats at the alternate site and is expected to take more at-bats Monday. ... 3B Gio Urshela (bone spur right elbow) played in a simulated game at the alternate site and is expected to be activated for Tuesday's game against Toronto. ... RHP Jonathan Loaisiga (undisclosed medical condition) threw a bullpen Sunday and will likely return Tuesday.

UP NEXT

Orioles: RHP Jorge López (1-0, 6.38) opposes RHP Touki Toussaint (0-1, 7.89) in the opener of a three-game series with Atlanta Monday in Baltimore.

Yankees: RHP Deivi García (1-1, 3.06 ERA) opposes RHP Taijuan Walker (3-2, 2.95) in the opener of a three-game series against Toronto Tuesday at home.