SAN FRANCISCO — Hanley Ramirez started talking before he was even asked a question.
"I know, I know," he said, smiling. "I was too aggressive."
Ramirez was referring to his lapses in judgment on the basepaths in the Dodgers' 3-2 victory over the San Francisco Giants on Saturday at AT&T Park.
Ramirez was caught stealing twice, the second time at third base with no outs in the ninth inning and the left-handed-hitting Andre Ethier at the plate. But what the former Miami Marlin did with the bat outweighed the sins of his legs, as he delivered the kind of hit that has eluded the Dodgers in recent days.
Ramirez's ninth-inning double off Giants reliever Jeremy Affeldt drove in Adrian Gonzalez for the winning run.
"It's unbelievable, it's unbelievable," Ramirez said. "Adrian tripled, and he picked everybody up. I was just trying to follow him. It's a good win — for our confidence, for everything. We have to get going now."
Ramirez's double ended a three-game losing streak for the Dodgers, who faced Giants ace Matt Cain.
Ramirez chased the first pitch Affeldt threw to him.
"After that, I said, 'What are you doing? Calm down, do what you know,'" Ramirez said.
The Dodgers' Big Four of Matt Kemp, Gonzalez, Ramirez and Ethier were a combined 0 for 17 the previous night. But Ramirez said the group's lack of selectivity wasn't necessarily a sign of trying to do too much.
"Sometimes you're not going to feel 100% at the plate," Ramirez said. "You're going to be jumping. You're going to be chasing. That's going to be part of the struggle. It's not that you're trying too hard. It's just that you're not seeing the ball well, and you don't know what you're supposed to do at the plate. Your mind's going fast."
Capuano duels Cain
The stage for Gonzalez and Ramirez's late-game heroics was set by Chris Capuano, who held the Giants to two runs and five hits over seven innings.
Capuano almost evenly matched Cain, who was charged with two runs and six hits over 71/3 innings.
Capuano didn't pitch more than six innings in any of his three previous starts. The left-hander identified one key in reestablishing his early-season form.
"Everything's off your fastball," he said. "The command felt pretty good today."
Kennedy also down
Utilityman Adam Kennedy could miss the remainder of the season with a strained right groin.
"He strained his groin pretty significantly," trainer Sue Falsone said.
Kennedy was injured on Friday night attempting to field a slow tapper by Hunter Pence in the sixth inning. The ball rolled under his bare hand and reached left field, allowing a run to score.
Kennedy said he expected to undergo an MRI exam on Monday.
In Kennedy's absence, Juan Uribe and Nick Punto will back up Luis Cruz at third base.
The Dodgers extended their affiliation agreements with triple-A Albuquerque and Class-A Rancho Cucamonga through the 2014 season.... Mark Ellis extended his hitting streak to six games with a first-inning single.... The start time of the Dodgers' Sept. 23 game in Cincinnati has been moved from 10:10 a.m. PDT to 5:06 p.m. to accommodate ESPN Sunday Night Baseball.