After a game the Dodgers led in the eighth, then thought they had a walk-off balk in the ninth, the Dodgers finally prevailed and now lead the National League West by 4½ games.
A.J. Ellis worked a leadoff walk in the 14th inning off Mike Broadway, then Jimmy Rollins and Chase Utley both singled to right field, loading the bases with nobody out.
Yusmeiro Petit entered in relief, but was greeted by Gonzalez with the game-winner, a drive over Norichika Aoki's head in left.
Jim Johnson worked around a single and his third 0-2 hit by pitch in his last two appearances to pitch a scoreless 10th, then got through a clean 11th.
Hatcher, his partner on the bullpen redemption tour, pitched a scoreless 12th inning through the heart of the order, including consecutive fly balls to the wall in center field and right field.
"They were outs," Hatcher said.
He then pitched a scoreless 13th, which also included an 0-2 HBP because why not?
Hatcher batted for himself with the bases loaded in the 13th, flying out to right field to end the inning, then went back out for the 14th inning. The three-inning outing was the longest of Hatcher's career, surpassing a 2⅓-inning stint on June 26, 2014 with Miami.
"Everybody out there understands it. Something weird is going to happen after it gets to a certain point," Hatcher said. "When I came in after the first inning, I noticed all the pitchers had their cleats on. That's something you don't see every day."
The Dodgers improved to 6-7 in extra innings. The Giants fell to 5-4.
Out of options
Carl Crawford singled with one out in the 11th against Santiago Casilla, then stole second base. With two outs, the Dodgers were out of position players, so Kershaw was sent to the plate as a pinch-hitter, the first Dodgers pitcher to be used as a pinch hitter since Zack Greinke on July 10, 2013 in Arizona.
Kershaw, the scheduled starting pitcher for Wednesday, grounded to second to end the inning.
With a one-run lead in the eighth inning and the heart of San Francisco's order due up, Juan Nicasio, not Kenley Jansen, was called on to pitch. After a leadoff walk to Matt Duffy, the plan looked like it might work, with a strikeout of Brandon Belt and getting Buster Posey to fly out, followed by an 0-2 count on Marlon Byrd.
But Byrd worked the count, Duffy stole second base, then Byrd doubled to right field to tie the score.
Jansen did pitch the ninth in a tie game, allowing a single but nothing else.
San Francisco rally
San Francisco's third-inning rally began innocently enough, with a play that shortstop Rollins probably should have made. Gregor Blanco hit a slow grounder to short, then slid headfirst into first base, barely beating Rollins' throw.
Rollins would later make several strong defensive plays to keep the game alive.
One out later, a walk and two singled loaded the bases, and Belt brought home the tying run with a single to center field. Brett Anderson got Posey to pop out in the infield for the second out, then got Marlon Byrd to hit a ground ball to second base.
Only a Chase Utley was shifted behind the bag and by the time he got to the ball two runs scored to give the Giants the lead, with terrific baserunning by Duffy bringing home the third run of the inning.
"For me personally it was probably the most frustrating game I've pitched. The pitch to Posey, you make a pitch to Byrd to get out of the inning, but the shift got me there," Anderson said. "The way I pitch, you live or die by the ground ball, and I kind of died by it today."
"That aside, you couldn't ask for a better team win. The bullpen was absolutely tremendous.
Those were the only three runs allowed by Anderson in his five innings.
The Dodgers got a quick run off Jake Peavy in the first inning thanks to a Justin Turner RBI double, then Peavy recovered to retire the next 10 batters he faced, with the Giants grabbing a 3-1 lead.
Carl Crawford got to third base with one out in the fifth inning, but Joc Pederson and Alex Guerrero took turns hearing boos after each struck out looking to end the inning.
After the boos, Dodger Stadium was mostly quiet if not anxious before Adrian Gonzalez came to the plate with one out and one on in the sixth. Gonzalez, hitting just .240/.302/.354 entering play on Monday, hammered a pitch into the pavilion in right center field to tie the game, breathing life back into the crowd.
One out later with a tie game and left-hander Josh Osich warming in the bullpen, Giants manager Bruce Bochy opted to stick with Peavy against Andre Ethier, who is on fire in August. Though Ethier was just 5-for-37 (.135) with no extra-base hits in his career against Peavy, that changed when he hit a ball just over the bullpen wall in right field, giving the Dodgers the lead.
Ethier hit .375/.420/.625 in August with nine extra-base hits in 69 nice plate appearances.
Anderson when he got Posey to pop out for the second out of the third inning reached 150 innings on the season, earning a $300,000 bonus in his contract. Anderson can earn up to $4 million in bonuses, with triggers every five innings until 200.
He ended his night with 152⅓ innings on the season. Anderson's next bonus is $300,000 for reaching 155 innings.
Even more weirdness
J.P. Howell was set to pitch the 15th inning, but after that the Dodgers would have been out of pitchers. Mat Latos, who started Saturday for the Dodgers, would have been brought into the game after Howell, but only to play right field, with Scott Van Slyke pitching.
Asked about Van Slyke's pitching repertoire, Ellis just laughed.
"Hopefully strikes," he said.
Home runs: Adrian Gonzalez (25), Andre Ethier (13)
WP - Chris Hatcher (2-5): 3 IP, 3 hits, 1 HBP, 4 strikeouts
LP - Mike Broadway (0-1): 0 IP, 3 hits, 1 run, 1 walk