Nate Schierholtz hit a two-run homer in the fourth inning and San Francisco won 5-2 Monday night for its fourth win in five games since the All-Star break.
The Dodgers have lost five in a row, including a four-game sweep at St. Louis, since the break and seven of their last 11. They dropped a season-high-tying six games behind the Padres.
"You get what you earn. Right now we've given a lot away and we have to find a way of getting back on track," manager Joe Torre said. "We've left a lot of men on base lately."
They dominated the Giants in the first half, winning five of six, including a three-game sweep last month in San Francisco.
But the Dodgers never got their offense untracked against Madison Bumgarner (3-2). The left-hander allowed two runs and six hits in 5 2/3 innings. He struck out three and walked two.
"It's pretty intense with the rivalry," Bumgarner said. "I wish I could've been a little more focused in the sixth. I definitely didn't make some pitches I needed to make."
"We've seen him quite a few times do that. It's part of Giants baseball," manager Bruce Bochy said. "It's not fun, believe me."