AP Sports Writer
BALTIMORE (AP) -- The high fastballs that worked so well for Miguel Gonzalez early in the game ended up soaring over the fence later in his outing against the New York Yankees.
Sixth-inning homers by Alfonso Soriano and Mark Reynolds sparked a comeback that enabled the Yankees to beat the Baltimore Orioles 7-5 on Tuesday night.
Chris Davis' 49th home run capped a four-run fifth inning that gave Baltimore a 4-1 lead in a game between AL East foes trying to make up ground in the wild-card race.
The margin dwindled to one run before Gonzalez could get three more outs. Soriano hit a fastball, and Reynolds did the same to make it 4-3.
"The third time around, they're going to get to that fastball," Gonzalez said. "I've just got to bring it down a little bit more. Those balls were supposed to be away and got away from me and were in the middle."
New York took the lead in the eighth against the Baltimore bullpen.
Alex Rodriguez led off with a double against rookie Kevin Gausman (2-5) and Robinson Cano delivered an RBI single. Soriano followed with a two-run shot to center, his 15th homer in 43 games since New York reacquired him in a July 26 trade with the Chicago Cubs.
"They made a good acquisition," Orioles manager Buck Showalter said. "He's been a good player for a long time. It's a good pickup for them."
Soriano could end up being the biggest reason New York gets into the postseason. He certainly played a big part in this victory.
"Tonight, we (trailed) 4-1 but we come back and get the win, the important win," he said. "We believe we have a very good offense."
After Soriano's second homer, successive doubles by Curtis Granderson and Reynolds off Francisco Rodriguez made it 7-4.
The defeat kept Baltimore 1½ games behind Tampa Bay for the second AL wild card.
"Of course it hurts," Gonzalez said. "We put up four runs in the fifth inning and I've just got to come in the sixth inning and try to minimize the damage and it just didn't work out."
Adam Warren (2-2) pitched a perfect seventh, Shawn Kelley gave up a sacrifice fly to Matt Wieters in the eighth and Mariano Rivera got four straight outs for his 650th career save. He has converted 42 of 49 chances this year.
The victory was manager Joe Girardi's 556th with the Yankees, tying Billy Martin for sixth place on the franchise list. Girardi and Showalter did not cross paths on the diamond after exchanging angry words Monday night over Baltimore allegedly stealing signs.
New York took a 1-0 lead in the third on an RBI double by Alex Rodriguez, but the advantage dissipated in the fifth.
Three straight singles off Yankees starter Ivan Nova produced a run, and with runners at second and third Nick Markakis hit a fly to left. After Brian Roberts tagged up and headed home, Alex Rodriguez cut off the throw from Soriano between third base and the mound, causing catcher Chris Stewart to raise his arms with a quizzical look because there was no other play on the bases.
One out later, Davis drove a breaking pitch into the center-field seats. He needs one home run to tie the franchise record of 50, set by Brady Anderson in 1996.
NOTES: Andy Pettitte (10-9) will pitch for New York against Baltimore RHP Scott Feldman on Wednesday night in the third game of the four-game series. ... The Yankees signed LHP Mike Zagurski to fortify the bullpen. Zagurski, who opted out of his minor league contract with Oakland on Sept. 1, arrived in Baltimore on Tuesday. New York transferred DH Travis Hafner (shoulder) to the 60-day disabled list to make room for Zagurski on the 40-man roster, most likely ending Hafner's season. ... Davis misplayed a grounder to first base, giving the Orioles 42 errors with 21 games left. The record low for a 162-game season is 65 by the 2003 Seattle Mariners. ... Yankees reliever David Robertson (shoulder inflammation) threw a bullpen and said he "didn't have any problems." Girardi said he expects Robertson to be available Wednesday. ... Girardi said SS Derek Jeter (sore ankle) is "still in a holding pattern."
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.