BALTIMORE (AP) Robinson Cano hit a tiebreaking homer leading off the ninth inning, and New York also got solo shots from Alex Rodriguez and Curtis Granderson in a 5-4 victory over Baltimore on Wednesday night.
The Yankees moved past Baltimore and Cleveland in the AL wild-card hunt. New York has hit eight home runs in winning two of three in the four-game series that concludes Thursday night.
The Yankees trailed 3-1 before Granderson homered in the fifth - New York's first hit - and Rodriguez tied it in the sixth with his 653rd career home run.
In the ninth, after Cano connected off Tommy Hunter (4-4), Granderson tripled with one out and scored on an infield hit by Lyle Overbay.
David Robertson (5-1) worked the eighth and Mariano Rivera gave up a run-scoring single to Brian Roberts before securing his 43rd save, tied for the major league lead with Baltimore's Jim Johnson.
Orioles slugger Chris Davis drove in two runs with a double, making him the first player in team history to have 40 doubles and 40 homers in a season. Danny Valencia tied a career high with four hits, and Roberts had three singles.
Baltimore outhit New York 13-6.
Before the game, the Yankees announced that shortstop Derek Jeter would miss the rest of the season with an injured left ankle. The Yankees captain played in only 17 games this season and made four trips to the disabled list.
ROYALS 6, INDIANS 2
CLEVELAND (AP) - Alex Gordon homered on the game's first pitch and Kansas City's James Shields dominated after a shaky first inning.
Kansas City took two of three in the series between clubs that are in contention for the second wild card spot in the AL. The Royals, who entered Wednesday trailing Tampa Bay by three games, moved a game closer to the Indians. Cleveland was 1 1/2 games behind the Rays.
The Royals had a home run, a triple and a single on the game's first seven pitches to take a 2-0 lead.
Shields (11-9) gave up two runs, two hits, and hit a batter in the bottom half of the first before taking control.
Michael Brantley had a two-run single in the first, but Shields didn't allow another hit until Jason Kipnis' leadoff single in the ninth.
Shields allowed four hits, struck out seven and walked one. Greg Holland retired the last three hitters for his 42nd save.
Scott Kazmir (8-8) allowed four runs and nine hits in four innings.
ANGELS 5, BLUE JAYS 4
TORONTO (AP) - Kole Calhoun hit a tiebreaking sacrifice fly in the eighth inning and C.J. Wilson won his eighth straight decision for Los Angeles.
Mark Trumbo hit a two-run home run, his career-high 33rd, and Josh Hamilton had three hits as the Angels won for the ninth time in 12 meetings with the Blue Jays.
Mike Trout drew a one-out walk off Steve Delabar (5-3) in the eighth and went to third on Hamilton's double. Trumbo was intentionally walked to load the bases for Calhoun, who hit a sacrifice fly to left.
Calhoun went 1 for 2 with two sacrifice flies, helping the Angels win for the fifth time in seven games.
Wilson (16-6) allowed four runs, three earned, in seven innings to match his career-high in victories, first set with Texas in 2011. The left-hander, who has not lost since July 5 against Boston, walked four and struck out six. He's 12-1 with a 3.02 ERA in 17 starts since June 14.
Ernesto Frieri worked the ninth for his 32nd save.
Moises Sierra went 3 for 4 with two doubles and a triple for the Blue Jays.
ARLINGTON, Texas (AP) - Clint Barmes homered and drew a bases-loaded walk as Pittsburgh completed a three-game sweep in an interleague matchup of wild-card leaders.
Justin Morneau, acquired from Minnesota less than two weeks ago, snapped an 0-for-14 slump with four hits while scoring twice for the Pirates.
Texas has lost nine of its last 12, a stretch in which the Rangers have lost four consecutive series. They have gone from a three-game lead in the AL West to entering Wednesday 2 1/2 games behind Oakland.
A.J. Burnett (8-10) struck out seven in 6 1-3 innings, though he faded late after retiring the first 13 batters he faced.