Pablo Sandoval homered twice in an eight-run fourth inning, part of a six-home run barrage that led the late-charging San Francisco Giants over the Colorado Rockies 12-5 Sunday for their eighth straight win.
On its longest winning streak since April 2007, San Francisco closed within four games of Atlanta, the NL wild-card leader.
The defending World Series champions have nine games left, including three against the Diamondbacks.
Cain (12-1) allowed five runs - three earned - five hits, four walks and two hit batters in five innings. He helped himself with two hits, including his first home run since May 13, 2008, against Houston.
In a four-game sweep of the Rockies, the Giants piled up 35 runs and 48 hits. Sandoval led the way with a seven hits, including three homers, in three games. He started the series by hitting for the cycle Thursday and ended it with his second multihomer game this season.
Sandoval led off the fourth with a homer to center off Esmil Rogers (6-6). One out later, Belt homered and Crawford doubled. Cain followed with a homer to center.
Sandoval ended the rally with his 22nd homer, a drive into the right-field bleachers, for 10-1 lead.
Fontenot had given the Giants a 2-0 lead with a two-run homer in the first, his 15th.
Colorado scored twice each in the fourth and fifth innings to close the gap, but a solo homer by Crawford, his third of the season, helped the Giants stay comfortably ahead.
Rogers allowed nine runs and seven hits in 3 2-3 innings, dropping to 0-4 with a 7.81 ERA since winning three straight starts in late July and early August.
NOTES: The Giants activated closer Brian Wilson from the 15-day DL. ... The previous Giants player to homer twice in the same inning was Juan Uribe last Sept. 23 against the Chicago Cubs. ... Rockies SS Troy Tulowitzki (left hip), 1B Todd Helton (back) and OF Carlos Gonzalez (right wrist) didn't play. Tulowitzki has missed five straight games and seven of the past nine. Helton has missed five straight games and 11 of the past 13 games, and Gonzalez missed his third straight game. ... The Giants open a three-game home series against the Dodgers on Tuesday. Two-time NL Cy Young Award winner Tim Lincecum will face Clayton Kershaw in the opener. ... Colorado finishes its home schedule with a three-game series against San Diego starting Monday.