SAN FRANCISCO (AP) - Hanley Ramirez hit a go-ahead RBI double in the top of the ninth inning and the Los Angeles Dodgers trimmed a game off their division deficit with a 3-2 win against the NL West-leading San Francisco Giants on Saturday.
Adrian Gonzalez led off the ninth with a triple against Jeremy Affeldt (1-2), then Ramirez came through with a double to the gap in right-center. That was the Dodgers' first hit in 15 tries so far this series with runners in scoring position.
Ronald Belisario (5-1) pitched out of trouble in the eighth for the victory, helping Los Angeles snap a four-game losing streak to rival San Francisco in a key September weekend.
Buster Posey hit an RBI single in the first and Brandon Belt added a go-ahead RBI with a groundout in the eighth for the Giants, who lead the Dodgers by 4 1/2 games.
The Dodgers were without center fielder Matt Kemp because of his troublesome left shoulder. He was scheduled for a contrasting MRI exam and also won't play Sunday. Infielder Adam Kennedy is expected to be done for the season after injuring his groin during Friday's 5-2 loss. Manager Don Mattingly said Kennedy was hurt when the third baseman tried to bare hand Hunter Pence's infield bouncer for an RBI single in the sixth inning.
Los Angeles pulled through with players down as it has many times in 2012.
Pinch-runner Alex Castellanos scored the tying run on a wild pitch in the top of the eighth to chase Giants starter Matt Cain. Juan Rivera doubled to start the inning and A.J. Ellis sacrificed him to third, where Castellanos entered. Bobby Abreu came in to pinch-hit and Cain threw wildly on full-count for ball four as Abreu drew a walk.
Santiago Casilla, Friday night's winning pitcher, relieved and escaped further damage but the Giants' bullpen couldn't pull off a second consecutive win.
Brandon League pitched the ninth for Los Angeles to earn his 11th save overall and second since joining the Dodgers from Seattle on July 30. He allowed Gregor Blanco's two-out double before retiring pinch-hitter Hector Sanchez on a liner to third.
Cain, who tossed a perfect game June 13 at home against the Astros, worked into the eighth inning but wound up with a third straight no-decision. He allowed two runs and six hits in 7 1-3 innings, struck out five and walked two.
Cain shut down the middle of the Dodgers lineup most of the way just as Tim Lincecum did a night earlier. That included Gonzalez, who came in with four career homers against Cain. Gonzalez's triple was his first hit of the day after he grounded into an inning-ending double play in the first and a pair of flyouts.
Cain threw two wild pitches in a game for just the second time after also doing so Aug. 29, 2010, against Arizona.
Chris Capuano gave up two runs and five hits in seven innings but saw his winless stretch reach five starts since a victory at Miami on Aug. 12. He is 0-2 and has only one victory over his past nine outings.
The lefty is 1-6 in 12 career outings and eight starts against the Giants, including a loss Aug. 22 at Dodger Stadium.
After Posey's hit, he retired 12 straight before Blanco beat out an infield single that manager Don Mattingly argued with first-base umpire Brian O'Nora. Replays showed Capuano's foot hitting the bag before Blanco made it. But he was later out in a close play at third that drew San Francisco skipper Bruce Bochy out of the dugout for words with umpire Alfonso Marquez.
Capuano singled in the sixth and became just the second Dodgers player to get beyond first when he advanced on Mark Ellis' single. The pitcher scored the tying run on Shane Victorino's sacrifice fly.
Notes: Posey threw out three players trying to steal, a career high. ... The Dodgers won in a game started by Cain for just the second time in the past eight matchups. ... The Giants also lost for just the fifth time in their past 17 against NL West opponents. Their final 23 games come versus the division. ... Anyelina Pagan, 7, announced her father's plate appearance leading off the third inning as a Giants "junior announcer." She said, "my daddy, Angel Pagan." ... On Sept. 8, 2004, the Dodgers became the first team in major league history to have pinch-hit grand slams in consecutive games when Olmedo Saenz delivered a day after Robin Ventura did it. ... LHP Clayton Kershaw (12-7) pitches in Sunday's finale for Los Angeles against fellow southpaw Barry Zito (10-8).