Robinson Cano hit a tiebreaking homer leading off the ninth inning, and the New York Yankees also got solo shots from Alex Rodriguez and Curtis Granderson in a 5-4 victory over the Baltimore Orioles 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.
The announcement coincided with the arrival of shortstop Brendan Ryan, obtained one night earlier in a trade with Seattle. Although Ryan went hitless, he performed flawlessly and showed good range in the field.
Yankees starter Andy Pettitte gave up three runs and nine hits over 6 1-3 innings. The 41-year-old lefty has gone 13 straight starts since September 2007 without losing to Baltimore, going 8-0 over that stretch. Pettitte has lost only twice to the Orioles since 2002 and is 28-6 lifetime against them.
Pettitte has pitched at least six innings in each of his last six starts and is 3-0 in seven outings since Aug. 5.
Baltimore's Scott Feldman allowed only three hits in 7 2-3 innings, two of them homers. The right-hander struck out six and walked two. His first walk came against the first batter of the game and the second was to the last batter he faced.
New York got a first-inning run when leadoff hitter Brett Gardner walked, stole second and scored on two groundouts.
The Orioles took a 2-1 lead in the third. Roberts and Manny Machado singled with two outs before Davis lined a two-run double through the shift into right-field.
Doubles by Valencia and J.J. Hardy made it 3-1 in the fourth, but Baltimore stranded runners at the corners.