DENVER -- Cristian Adames hit a two-run double in the ninth inning off veteran Joe Nathan to rally the Colorado Rockies past the San Francisco Giants 6-5 on Wednesday night.
Nolan Arenado homered to start the three-run rally, and Tom Murphy and David Dahl also went deep for the Rockies.
With Colorado trailing 5-3, Arenado led off the ninth with his NL-leading 37th home run off Santiago Casilla. After Murphy's one-out single, Jake Osich (1-1) entered and hit pinch-hitter Charlie Blackmon. Nick Hundley's bloop single off Nathan loaded the bases, and Adames lined a double off the wall in right to end it.
Jordan Lyles (4-4) pitched the ninth to get the win.
The Giants hold the first NL wild-card spot by a half game over the St. Louis Cardinals and New York Mets. They are 17-32 since the All-Star break.
The Giants built an early lead on homers by Brandon Belt and Gorkys Hernandez, who had two hits each.
Hernandez, who turned 29 on Wednesday, doubled ahead of Belt's two-run homer in the second and led off the fourth with his first home run since Oct. 2, 2012, with Miami, to make it 4-1.
The Rockies crept back into the game with consecutive home runs by Dahl and Murphy in the fourth. Hunter Pence made it a two-run game in the fifth with a double, one of his three hits.
Giants: RHP Jake Peavy (strained lower back) was activated off the 15-day disabled list. ... Manager Bruce Bochy gave INF Joe Panik and OF Denard Spana night off.
Rockies: 1B Gerardo Parra left the game following the first inning after suffering a right hamstring strain stretching for a throw from 3B Nolan Arenado. ... RHPJason Motte (right shoulder strain) threw 25-30 pitches in a simulated game. ... 1B Mark Reynolds was away from the team for the birth of his son, Declan James, who arrived Tuesday. Reynolds will join the team in San Diego.
Bochy took advantage of the expanded rosters by stuffing his bullpen. San Francisco had 14 relievers available Wednesday, and the manager used eight, six in the final two innings.
The Giants had 13 hits Wednesday after getting eight the night before. Prior to that, they'd gone five straight with four-or-fewer hits.
Giants: LHP Madison Bumgarner (14-8, 2.51) opens a three-game series at Arizona on Friday night. Bumgarner has won four of his last five starts and got his fifth double-digit strikeout game against the Cubs on Saturday.
Rockies: RHP Jeff Hoffman (0-2, 6.60) goes for his first major league win in his fourth career start when the team opens a four-game series at San Diego on Thursday.