BALTIMORE (AP) -- Steve Pearce doubled in a ninth-inning run and scored the game-winner on a double by Kelly Johnson as the Baltimore Orioles beat the New York Yankees 3-2 Sunday night to inch closer to the AL East title.
Any number of Orioles wins and Toronto losses totaling three will give Baltimore its first division title since 1997.
The winning rally came after Brian McCann hit a tiebreaking homer off Darren O'Day (5-1) in the top of the ninth.
Nelson Cruz opened the bottom half with double off David Roberson (2-5). Pinch-runner Quintin Berry scored on Pearce's liner into the left-field corner, and one out later, Johnson - a former Yankee - delivered the game-winner into the gap in right-center.
Baltimore celebrated its seventh win in eight games by crowding around Johnson at second base.
Martin Prado homered for the Yankees, who lost three of four to the Orioles and dropped five games behind Kansas City in the race for the second wild-card spot.
Dellin Betances struck out two in the eighth inning to raise his total for the season to 130, tied with Mariano Rivera for most by a Yankees reliever.
Yankees shortstop Derek Jeter was honored and showered with gifts before his final game at Camden Yards. The 40-year-old Jeter, who will retire after this season, went 0 for 4 and is hitless in his last 24 at-bats.
His slump is indicative of the Yankees' hitting woes of late. Second baseman Stephen Drew interrupted a 2-for-35 skid with a fifth-inning bunt, and New York scored only six runs in the four-game series.
Orioles starter Chris Tillman gave up one run and five hits in 6 2-3 innings, his 19th consecutive start in which he allowed three runs or fewer.
Yankees right-hander Hiroki Kuroda limited Baltimore to one run and six hits over seven innings.
Prado led off the second with a drive that barely cleared the glove of a leaping Alejandro De Aza and landed in the left-field seats.
Kuroda permitted only one baserunner in the first four innings. In the fifth, a pair of broken-bat singles put runners at first and third with two outs before Jonathan Schoop bounced into a fielder's choice.
De Aza singled with one out in the sixth and Adam Jones hit a hooking liner that nicked the outstretched glove of Prado at third and went into left-field corner for an RBI double.
Yankees: C Francisco Cervelli, who's missed 13 straight games with cluster headaches, could return in the next day or two. He says he hasn't experienced symptoms in about a week and has been catching in the bullpen.
Orioles: In order to stay healthy for a possible playoff appearance, suspended 1B Chris Davis will head to Sarasota soon to work out at the team's spring training facility. Davis began a 25-game suspension on Friday for amphetamine use.
Yankees: New York sends Chris Capuano (2-3, 4.90 ERA) to the mound against Tampa Bay.
Orioles: Wei-Yin Chen (15-4) seeks his first career win against the Blue Jays in the opener of a three-game set. The lefty is 0-2 with an 8.10 ERA in two starts against Toronto.