An uncharacteristically off-target Matt Cain was far from his dominant self, but still held the Mets in check for five innings, allowing two runs on seven hits and three walks.
"I felt fine in the bullpen, but for some reason I went out there and it all changed," Cain said. "I just battled myself the whole time. It was a long five innings for me."
The go-ahead play came on Cain's second pitch of the game, when Ruben Tejada opened the game by drilling a home run to left field for his first career leadoff home run.
"It was a pitch in and it wasn't a terrible pitch," Cain said. "He just put a good swing on it."
The Mets got another run in the second when Jordany Valdespin grounded into a forceout with the bases loaded to score Josh Thole from third.
Bochy had George Kontos warming up in the bullpen in the top of the third after Cain opened the inning by walking Ike Davis and Daniel Murphy. Cain got out of the jam by striking out Jason Bay and Mike Baxter, with Posey ending the inning by throwing out Davis at third base. Cain's pitch count was at 71 pitches through three innings and finished at 97 pitches in five innings, matching his shortest outing of the season.
"He was battling himself out there, but that's how tough he is and how competitive he is," Bochy said. "Two runs in five innings, that's not bad considering the pitches he threw, and he gave us a chance."
Cain was bested by Mets starter Jon Niese, who struck out five batters in seven innings. Pence's debut wasn't enough to spark the Giants, with the newly acquired two-time All Star going hitless in his four at-bats.
"We didn't do what they brought me here to do, but it's only one game," Pence said.
After the Mets loaded the bases with no outs in the eighth, Thole hit a grounder to first, which Brett Pill fielded to throw Murphy out at home. On Posey's ensuing throw to first, the ball caromed off Thole's shoulder and bounced way out of play with Bay coming around to score. But the umpires ruled that Thole was running inside the basepaths, calling him out and sending Bay back to second base because it was a dead ball.
After Justin Turner walked, a diving Ryan Theriot got Tejada out on a grounder to end the rally.
"That's a bad rule," Mets manager Terry Collins said of Thole being ruled out. "Unless they put first base outside that line, that's a bad rule. Because sooner or later, you've got to come inside that line or else you're going to break your leg."
The Giants kept their one-game lead over the Dodgers with Los Angeles' 4-0 loss to the D-backs, who are now 2 1/2 games behind the Giants.
"It's a tough one to lose because we were dodging bullets all night," Bochy said. "We were fortunate to be in that game."