Angel Pagan hit a tiebreaking two-run single in the sixth inning, Matt Cain settled down after a shaky start and the San Francisco Giants won their 10th straight over Colorado, rallying from a six-run deficit to beat the Rockies 8-6 on Thursday night.
Brandon Crawford added a three-run double to help San Francisco and Marco Scutaro extended his hitting streak to 15 games.
The NL West-leading Giants also extended their mastery over the Rockies, improving to 31-9 since 2011.
Cain (3-2) struggled early, giving up homers on consecutive pitches to Todd Helton and Nolan Arenado in the second, along with a three-run homer to Wilin Rosario an inning later.
After that, Cain found his rhythm before being pulled with an out in the seventh. In 6 1-3 innings, he gave up nine hits but still moved to 3-0 this month.
Jeremy Affeldt held the Rockies hitless in two innings of relief work before handing the ball over to closer Sergio Romo, who got two outs to earn his 13th save in 15 chances. The Rockies only had one hit after Rosario's home run.
Jhoulys Chacin (3-3) was solid early before the hard-throwing righty fell apart. He yielded a season-high eight runs in 5 1-3 innings to a powerful Giants lineup that came into the game hitting an NL-best .267.
With this performance, Chacin's ERA soared from 2.70 to 4.07.
Trailing by six, the Giants climbed back into the game with a five-run fourth inning. Brandon Belt brought in a run with a walk, with Crawford later adding a bases-clearing double. Cain also got into the scoring act, driving in Crawford with a single. It was Cain's second RBI of the season.
Gregor Blanco tied the game in the sixth with a sacrifice fly to center. Pagan gave the Giants an 8-6 lead with a two-out, two-run single over the head of reliever Adam Ottavino, who was brought in for Chacin.
Cain struggled with his command early. He gave up three runs each in the second and third innings. Cain allowed back-to-back homers to Helton and Arenado. Helton stood at home plate to watch his two-run homer — not so much to admire his handiwork as see if it would curve foul. It didn't and he trotted around the bases.
On the next offering from Cain, Arenado lined a 91 mph fastball into the seats in left-center. It was his fourth homer of the season.
Rosario had the big blow in the third, hitting a three-run homer to right. Cain has allowed 13 homers this year. He gave up 21 all of last season and just nine in 2011.
Instead of accompanying the team to Toronto for a two-game series, Cain arrived a day early in Denver. His teammates gave him grief over the move, but manager Bruce Bochy insisted it made sense.
"It's the right thing to do," Bochy said.
Before the game, Colorado juggled its roster by placing left-hander Jeff Francis (groin) on the 15-day disabled and designated infielder Reid Brignac for assignment. The team also recalled infielder D.J. LeMahieu and right-hander Rob Scahill from Triple-A Colorado Springs.
LeMahieu had a pinch-hit single in the sixth.