Credit this one to San Francisco's pitchers, who limited Milwaukee to six hits, and the catchers, who generated all of the Giants' runs. San Francisco received Posey's three-run homer in the first inning before going virtually silent at the plate, mustering five hits from the second inning through the 13th.
Then Sanchez, who replaced Posey as part of a double-switch in the 12th inning, clobbered a 1-0 fastball from Juan Perez, Milwaukee's fifth reliever, over the left-field wall for his second home run of the season.
"I went in with the mentality of looking for a fastball and trying to hit it hard," said Sanchez, who related that he had never hit a game-winning home run on any level of organized baseball, amateur or professional.
Santiago Casilla (1-2) blanked Milwaukee over the final two innings to earn the decision for the Giants, who improved to 4-1 in extra innings as they opened a seven-game, two-city trip.
Casilla contributed three strikeouts to the season-high total of 17 amassed by San Francisco's pitchers. The primary contributor was starter Madison Bumgarner, who struck out 10, yielded five hits and walked one in 7 2/3 innings.
Maintaining a 3-1 edge, Bumgarner appeared bound for a dominant victory.
"His command of his changeup was as good as I've seen, probably ever," Posey said.
But another in a season-long series of defensive miscues helped Milwaukee tie the score. Shortstop Brandon Crawford mishandled Norichika Aoki's grounder for an error with two outs in the eighth inning. The ball took an unusually high hop before it reached Crawford, which may have increased the play's difficulty. It was the Giants' 44th error of the season, giving them the Major League lead in this dubious category by one over San Diego.
And the lapse proved crucial as Ryan Braun whipped Bumgarner's 1-2 pitch into the second deck in left field.
Right-hander Sergio Romo, who would have been the percentage choice to face Braun rather than the left-handed Bumgarner, had warmed up in the bullpen. But Bochy opted to stick with Bumgarner. With the formidable Aramis Ramirez on deck, Bochy didn't want to pitch around Braun, either.
"That kid was throwing the ball so well," Bochy said of Bumgarner, who recorded his fifth career double-digit strikeout effort. "I had all the confidence in the world in him. That's why I left him to pitch. He was throwing the ball great."
Bumgarner said that the fateful slider he threw to Braun "really wasn't a bad pitch. I probably should have buried it." But, Bumgarner noted, he had thrown it earlier in the count, so Braun was ready for it.
"That's what great hitters do," Bumgarner continued. "He made a good adjustment and hit it about as far as he can hit it."
Braun graciously praised Bumgarner.
"He was good, man," Braun said. "He's been one of the best pitchers, I think, in the National League since he's been in the big leagues. His cutter was really on tonight. It's his best pitch, and when he's throwing it well, he's definitely pretty tough to get runs against."
The transition from Bumgarner to the bullpen was seamless. Five Giants relievers combined to yield one hit in 6 1/3 innings. Only one Brewer reached scoring position in this span.
At the outset, nobody would have guessed that a four-hour, 34-minute marathon was in store as the Giants established immediate control. With one out in the first inning, Randy Wolf's radar malfunctioned, as the Milwaukee left-hander walked Crawford and Melky Cabrera consecutively. Up came Posey, who ended a homerless stretch of 69 at-bats by planting a 2-1 pitch halfway up the second deck in left field.
"The past week or so, I've been feeling more comfortable," said Posey, who's batting .389 (7-for-18) in his last five games. "I've had a pretty good approach."