Updated

Clayton Kershaw had been unbeatable pitching at home, especially against the rival San Francisco Giants.

But they caught up with the reigning NL Cy Young winner in a 2-1 victory on Tuesday night.

Kershaw gave up a two-run homer to Brett Pill in the second inning on his way to having two streaks snapped — his career-high 10-game overall winning streak and his franchise-tying 12-game home winning streak.

"I don't care about that. It's just frustrating to lose," he said. "It's probably one of the better days I felt this season. I had one rough inning, but overall, I felt pretty good."

Kershaw lost at home for the first time since April 16, 2011, against St. Louis. He came in with a 6-0 mark against the Giants that dated to Aug. 1, 2010.

"He was on. He had all of his pitches working," catcher A.J. Ellis said. "That's probably the first time all year that we've had all four working at the same time. He did everything we asked him to do."

Ryan Vogelsong (1-2) allowed eight hits while walking three and striking out one for the Giants.

The Dodgers loaded the bases against Vogelsong in the bottom of the eighth inning. Pinch-hitter Bobby Abreu walked, Dee Gordon reached on a bunt single to Vogelsong, and Mark Ellis had a sacrifice bunt. Vogelsong intentionally walked Matt Kemp before turning it over to Javier Lopez, who got Andre Ethier to ground into a double play — one of four the Giants' defense turned a night after committing three errors.

"If I can get Andre up there with the bases loaded with one out, I'll take that any day," Dodgers manager Don Mattingly said. "We didn't finish the deal, but it's not one of those decisions that I would look back on and change. I'm going to bunt the guys over and put my two best two RBI guys up there and make them make a choice."

Lopez got the first two outs in the ninth and Santiago Casilla retired Juan Uribe for his sixth save in seven attempts.

Vogelsong pitched into the eighth inning for the first time this season.

Kershaw (2-1) had his career-best 10-game overall winning streak end with his first loss since last Aug. 7 at Arizona. He gave up two runs and five hits in eight innings, struck out seven and walked one.

Pill homered over the left field wall on his first pitch from Kershaw in the second inning, scoring Buster Posey who led off with a single. Pill's homer ended a six-game drought for the Giants, and was just their second in their last 10 games.

"It was a fastball in. We would have preferred it was farther in, but give him a lot of credit for being able to jump on that first pitch and drive it out of the ballpark," Ellis said. "We're both more upset about the pitch before with Posey. It just missed the spot, and they were able to get that leadoff man on."

The Dodgers' run came on James Loney's RBI double in the bottom of the second that snapped his 0 for 13 skid. It was the fewest runs they scored in a loss since a 12-0 defeat at Houston on April 22.

NOTES: Giants CF Angel Pagan left the game in the eighth inning with tight left hamstring. Bochy said he may give him a night off Wednesday. ... Dodgers LF Juan Rivera also went out in the eighth after feeling discomfort in his left leg. ... The Giants improved to 7-7 in one-run games this season; while the Dodgers dropped to 9-6. ... Kershaw came within a win of tying Carl Erskine for the longest home winning streak in franchise history. ... Former Dodgers 3B Casey Blake retired Tuesday. The 38-year-old spent spring training with Colorado, but was released in late March and attracted little interest from other teams. Blake played parts of four seasons in Los Angeles, although last season was interrupted by three stints on the DL and neck surgery. Mattingly says he could see Blake working as a major league coach. ... Dodgers INF Jerry Hairston missed his second straight game with a strained left hamstring.