SAN FRANCISCO -- After Don Mattingly's spirited pregame insistence that his Dodgers weren't dead, they backed up the manager with enough life for a 3-2 win over the Giants on Saturday even without Matt Kemp.
While Kemp was getting an MRI on his ailing left shoulder, the Dodgers tied the game with an eighth-inning run on a wild pitch and won it in the ninth, Adrian Gonzalez leading off with a triple and Hanley Ramirez doubling him home off reliever Jeremy Affeldt.
"I don't know about winning the division. I just know we're getting in the playoffs one way or another," predicted Gonzalez, the cornerstone of the blockbuster trade that was made to ensure a Dodgers postseason.
The win snapped a three-game losing streak and pulled the Dodgers back to within 4 1/2 games of the Giants with Clayton Kershaw starting Sunday's rubber game of the series.
Since the trade, Gonzalez is hitting .241 with a .379 slugging percentage, but also has 10 RBIs in 14 games.
The usually stoic Gonzalez popped up from his slide into third with an expressive hand clap and a point at the Dodgers dugout.
"In a big-game situation I will," he said of his display. "That's about as much as you're going to see from me. That's like somebody else jumping up and down for 30 seconds."
"We'll change that next year," Kemp said.
Gonzalez continued, saying he shows more emotion in private, especially when he struggles the way he has been.
"You guys don't go to the tunnel after a bad at-bat," he said. "Bats slam, chairs get thrown. But I don't like to show it on the field. I've always been a guy who thinks that shows weakness to the other team."
A bigger ninth inning for the Dodgers was thwarted when Ramirez was caught stealing third base on a 3-0 pitch for the first out of the inning while Andre Ethier was taking ball four.
"We've got to talk about the caught-stealing," Mattingly said. "That doesn't make sense to me."
Ramirez admitted he got a little too aggressive, but with an explanation.
"Adrian's triple kind of got everybody up and we were just trying to follow him," said Ramirez, who also was caught stealing in the second inning.
The Dodgers won Saturday even though it seemed everything was against them. Kemp was out of the lineup, San Francisco Cy Young candidate Matt Cain was starting against struggling Dodgers lefty Chris Capuano and the Giants were a Major League-best 30-14 against left-handed starting pitchers.
But Capuano shook off a wobbly first inning and dueled Cain evenly for seven innings. Ronald Belisario picked up his fifth win in relief and substitute closer Brandon League got his second Dodgers save, surviving a real scare with two out in the ninth when rookie callup Alex Castellanos dropped Gregor Blanco's double as he hit the left-field fence.
"It was an awesome atmosphere," said Capuano. "We're at a point where every game is a must-win. A beautiful day, packed house, couldn't ask for a better setting than today."
The Giants were on the attack early, scoring in the first inning on three consecutive hits. Marco Scutaro, whose two-run single won Friday night's game, started the rally with a double, Pablo Sandoval extended it with a single and Buster Posey cashed it in with a line single off the glove of diving third baseman Luis Cruz.
Meanwhile, the Dodgers' offense got off to an ominous start, getting leadoff singles in the first and second innings by Mark Ellis and Ramirez, only to have the innings end with double-play grounders by Gonzalez and Cruz.
It took a heads-up play by catcher A.J. Ellis in the fifth inning to overcome a missed call at first base by umpire Brian O'Nora, who ruled that Blanco beat out a bunt single, when replays showed Capuano hit the bag before Blanco.
"That's a Spring Training play -- all the way to the back fields in Vero Beach, Fla., in 2003," said Ellis. "It's the catcher's responsibility to cover third base."
Cain followed with a sacrifice-bunt attempt that required Cruz to charge and throw to first. Blanco saw third base uncovered and tried to go first to third, but Ellis took off from the plate, beat Blanco to the bag, took Mark Ellis' throw from first and made a diving tag of Blanco for a 5-4-2 double play.
Capuano had to get the tying run himself. He singled with one out in the sixth, raced to third on Ellis' single and scored on Shane Victorino's sacrifice fly.
The Giants took the lead again in the seventh. Posey led off with a double that exploded at the feet of Cruz and went into the left-field corner. With Ronald Belisario warming up, Hunter Pence bunted Posey to third for the first sacrifice of his career. Joaquin Arias was walked intentionally to bring up the left-handed Brandon Belt. Capuano's first pitch was lined by Belt off the pitcher's glove, and Posey scored as Capuano retrieved the ball to get the out at first. Blanco was walked intentionally and Cain struck out.
The Dodgers tied it again in the eighth. Juan Rivera led off with a double down the right-field line off the glove of Pence, despite his diving attempt. A.J. Ellis bunted Rivera to third. With Castellanos running for Rivera, Bobby Abreu pinch-hit for Capuano. Cain's 3-2 pitch was way inside, knocking off Posey's glove and rolling to the backstop. With Cain covering the plate, Castellanos beat Posey's throw to tie the game, with Abreu walking and Cain leaving.
"There's a lot of baseball left," said Giants manager Bruce Bochy. "It's going to be a fight; we know it. That's our nature. We never do anything easy. We have to come out here and work hard every day. There's a lot of baseball left, that's the way we have to look at it. We have to play our game and see what happens."
Ken Gurnick is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.