DENVER -- 'Just keep swinging' the D-backs told themselves Sunday.
Even when they coughed up a mid-game lead, they knew this was Coors Field and runs can come in bunches.
And that's how it happened for the D-backs, who scored six runs in the final two innings to beat the Rockies, 10-7, on Sunday afternoon.
"You keep grinding," D-backs manager Kirk Gibson said. "You never want to give in."
The D-backs have won the first three games of the series and go for a sweep on Monday.
With the victory, the D-backs remain 4 1/2 games behind the Cardinals for the final National League Wild Card spot. Arizona passed the Phillies, who fell to the Braves on Sunday. The Brewers and Dodgers are still in between the D-backs and that last Wild Card spot.
The Rockies continued to struggle, having now lost nine in a row and 17 of 19.
It looked like Colorado might get back in the win column after the Rockies put together a rally of their own.
Trailing 3-0, with Ian Kennedy pitching well against them, the Rockies scored three runs in the fifth and added another in the sixth to take a 4-3 lead.
Colorado's bullpen, however, could not hold it.
Pinch-hitter John McDonald led off the eighth with a single off Rex Brothers and after Matt Belisle came on to strike out pinch-hitter Miguel Montero, Wil Nieves and Mike Jacobs followed with hits of their own, with Jacobs' single scoring McDonald.
Belisle was able to strike out Adam Eaton for the second out of the inning and nearly did the same to Hill, but after fouling off three two-strike pitches Hill hit a slider into the seats in left for a 7-4 Arizona lead.
"He threw some good pitches and I was just able to fortunately foul it off until I was able to get a pitch to hit," Hill said. "You always want those long at-bats especially in those late innings to produce a little bit and it ended up working out."
The D-backs got offensive contributions from some unlikely sources.
There was Nieves, who was starting for Montero for the first time since Aug. 29. He contributed a 4-for-5 game that prompted Montero to jokingly pack up his equipment bag postgame and tell the media he had been traded because Nieves hit so well in his place.
"I'm just relaxed," Nieves said. "I know no matter what, I do know Miggy is going to play the next day, you know, and I'm just having fun. When it's my opportunity I don't put pressure, I just try to put up good at-bats and call a good game and win that game. Obviously it's always awesome when you get one hit, but getting four, that's just a blessing."
Jacobs picked up his first hit in his fifth at-bat since being called up from Triple-A Reno.
"He ended up leaving a fastball over the plate and I put a good swing on it and tied the game," Jacobs said. "Then Aaron came up and hit the big homer. It was a good inning for us right there."
And it was an inning that left Rockies manager Jim Tracy shaking his head in disgust.
"That's the difference in the game obviously," Tracy said of the eighth. "We didn't get the people out that we needed to get out in that inning. We let guys on that we have the capability of getting out, but they got big hits for them. That's pretty much what it all boils down to."
The D-backs tacked on three runs in the ninth thanks to a two-run single by Jake Elmore and an RBI groundout by A.J. Pollock. Those runs proved to be crucial as reliever Takashi Saito struggled in the bottom of the ninth and gave up three runs before closer J.J. Putz came on to shut things down.