PHOENIX - Adam Eaton hit the first pitch of the bottom of the ninth inning for a game-ending homer and the Arizona Diamondbacks beat the Baltimore Orioles 7-6 on Monday night.

Arizona trailed 4-2 before stringing together three straight run-scoring singles in the seventh inning to take the lead.

Chris Davis tied the game in the eighth inning with major league-leading 43rd homer.

Wil Nieves then led off the bottom half with his first homer in a year to put Arizona up 6-5.

Baltimore tied it in the ninth on Nick Markakis' sacrifice fly off Brad Ziegler, but Eaton put an end to a night of momentum swings by sending the first pitch by Darren O'Day into the pool in right-center to set off a wild celebration.

Aaron Hill homered for the third straight game in Arizona's 23rd win in its last at-bat and 33rd comeback victory.

Matt Wieters homered and Brian Roberts had two RBIs for the Orioles. Orioles starter Scott Feldman was sharp except for the second inning.

Hill led off with his eighth homer and Gerardo Parra scored from second on a wild pitch later in the inning.

Feldman was good after that, allowing two runs - one earned - and four hits with eight strikeouts in 5 1/3 innings.

Brian Matusz opened the seventh inning by hitting Didi Gregorius, and Eaton, Hill and Martin Prado followed with run-scoring singles off Tommy Hunter to put the Diamondbacks up 5-4.

Joe Thatcher couldn't hold the lead, either, giving up a solo homer to left by Davis that tied the game at 5-all.

Then it was Ziegler's turn to blow a lead.

Aided by first baseman Goldschmidt's inability to get the ball out of his glove on Nate McLouth's infield single, the Orioles loaded the bases with one out and Markakis tied the game.

Eaton followed Ziegler's first blown save in eight chances with his first homer of the season and was mobbed by his teammates as he crossed the plate.