''Cain pitched a good game and pounded the zone,'' Kemp said. ''He threw strikes, mixed his pitches up well and got them over the plate. We couldn't really get anything off of him. But we waited him out, got him out of there, got to their bullpen and scored some runs at the end for the W.''
Zack Greinke (6-1) allowed two runs and six hits in seven innings, striking out eight and walking three. The right-hander extended his streak to 20 consecutive starts in which he's allowed fewer than three runs -- the longest by any pitcher since the ''dead ball'' era.
''It's always a luxury to have two Cy Young winners at the top of your rotation like Zack and Clayton Kershaw. That's a plus for our team,'' Kemp said. ''Hopefully they'll continue to stay healthy and keep doing what they're doing. But we have to do our job as hitters and drive in runs for those guys.''
The Dodgers took the lead in the seventh against reliever Jeremy Affeldt (0-1) when Drew Butera doubled and scored on Gordon's hit inside third base with Pablo Sandoval playing in on the grass with the Dodgers' speedy leadoff hitter at bat. Puig then greeted Jean Machi with a ground-rule double into the left field corner.
''That's a bad break,'' Giants manager Bruce Bochy said. ''Pablo had to cover the bunt with two outs. Gordon hit it in a good spot, and the ball just bounced by him.''
The four runs charged to the Giants' bullpen was in sharp contrast to the major league-best 1.75 ERA they brought into the game. Affeldt had pitched 10 2/3 scoreless innings in his 10 previous appearances since coming off the DL on April 16.
''They got nicked up a little, but they had been so good and really solid all year,'' Bochy said. ''It's going to happen.''
Former Giants closer Brian Wilson escaped a bases-loaded jam in the eighth, retiring Hunter Pence on a foul pop to Butera behind the plate after a visit from pitching coach Rick Honeycutt. The Dodgers tacked on two more runs in the bottom half on Kemp's leadoff homer against Juan Gutierrez and Butera's sacrifice fly.
Cain was charged with two runs, three hits and four walks over five-plus innings in his first start off the disabled list. The three-time All-Star hadn't pitched since April 23 and missed two turns in the rotation because of a cut on the tip of his index finger. He was hurt in the clubhouse kitchen at AT&T Park when he tried to catch a knife that fell out of his hand.
Affeldt came on in the sixth with the bases loaded and none out after Cain gave up two walks around a towering single by Puig. Gordon scored on a double-play grounder by Adrian Gonzalez and Kemp followed with an RBI single that tied it 2-all.
''It kind of got out of hand in the sixth,'' Cain said. ''I let that inning get away from us and that ended up being a turning point.''
Greinke escaped a bases-loaded jam in the first by fanning Sandoval, who hasn't driven home a run in 20 games and 68 at-bats since his RBI single against the Dodgers on April 16. He has only two hits in his last 26 at-bats with men in scoring position.
The Giants loaded the bases again in the second with none out, and managed to scratch out two runs. Hunter Pence drove in Angel Pagan with a sacrifice fly to center and Brandon Hicks scored on Buster Posey's single.
Less than 24 hours after Dodgers left-hander Paul Maholm broke the left thumb of Giants first baseman Brandon Belt with a pitch, Cain plunked Hanley Ramirez above the left elbow on a 1-2 pitch after Gordon led off the first inning with a single and stole two bases. But Cain escaped the jam, striking out Gonzalez and retiring Kemp on a flyball.
Dodgers 3B Juan Uribe missed his second straight game with a sore right hamstring -- and for the second straight game his replacement committed a throwing error. Friday it was Justin Turner, and this time it was Chone Figgins. ... Gonzalez is 2 for 31 over his last eight games following a 16-game hitting streak. ... The Dodgers lead the majors with 44 stolen bases, including 24 by Gordon in 27 attempts - also the most in both leagues. The last time a Dodgers player led the NL in steals was 1976, when current first base coach Davey Lopes won his second straight stolen base crown.