Pence, who was obtained in a trade with Philadelphia last month, had struggled in the eight games since the deal, batting only .156 over 32 at-bats.
But that changed Sunday when his two-out fly ball to left-center field off Rafael Betancourt barely cleared the fence to score Angel Pagan and Melky Cabrera ahead of him, capping a five-run rally that gave San Francisco the victory.
Cabrera (three RBI) and Buster Posey drove in runs off Matt Belisle (3-4) during the decisive inning as the National League West-leading Giants rallied from a 6-4 deficit and took the rubber match of a three-game series.
Brandon Belt went 4-for-4 with an RBI in the victory.
Clay Hensely (4-3) held the Rockies to one run over two innings to earn the win, which enable the Giants to hang onto a one-game lead over the Los Angeles Dodgers in the NL West.
Eric Young 3-for-5 with a run-scoring double for the Rockies.