Dodgers reliever Brian Wilson got the win in his first game against the Giants.

Photo: Jae C. Hong, Associated Press

Dodgers reliever Brian Wilson got the win in his first game against...

Image 2 of 5

San Francisco Giants starting pitcher Matt Cain throws the ball to first base after fielding a bunt hit by Los Angeles Dodgers' Mark Ellis during the seventh inning of a baseball game on Thursday, Sept. 12, 2013, in Los Angeles. Ellis was out at first. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

San Francisco Giants starting pitcher Matt Cain throws the ball to...

Image 3 of 5

San Francisco Giants' Gregor Blanco lies on the field after he was caught trying to steal second base during the seventh inning of a baseball game against the Los Angeles Dodgers on Thursday, Sept. 12, 2013, in Los Angeles. (AP Photo/Jae C. Hong)

Photo: Jae C. Hong, Associated Press

San Francisco Giants' Gregor Blanco lies on the field after he was...

Image 4 of 5

LOS ANGELES, CA - SEPTEMBER 12: Shortstop Brandon Crawford #35 of the San Francisco Giants can't reach a single hit by Hanley Ramirez of the Los Angeles Dodgers in the first inning at Dodger Stadium on September 12, 2013 in Los Angeles, California. (Photo by Stephen Dunn/Getty Images)

Photo: Stephen Dunn, Getty Images

LOS ANGELES, CA - SEPTEMBER 12: Shortstop Brandon Crawford #35 of...

Image 5 of 5

LOS ANGELES, CA - SEPTEMBER 12: Gregor Blanco #7 of the San Francisco Giants hits an RBI single to tie the game in the ninth inning against the Los Angeles Dodgers at Dodger Stadium on September 12, 2013 in Los Angeles, California. (Photo by Stephen Dunn/Getty Images)

Los Angeles -- - It was a confrontation that was bound to happen, the Giants versus the blue B-Weezy, and it happened right away Thursday night, with Brian Wilson accomplishing what he always seemed to do when he wore the black and orange.

He succeeded.

Wilson was the winning pitcher in his first game against the Giants, throwing a scoreless 10th before Adrian Gonzalez gave the Dodgers a 3-2 victory in the bottom half with a one-out single against Jeremy Affeldt, who was pitching in his first game since a July 20 groin injury shelved him.

Buster Posey, who saw thousands of Wilson pitches from the squat, got to face him in the box and flied out after Wilson walked Brandon Belt with one out. Hunter Pence, whose 21st homer started the scoring at Dodger Stadium eight innings earlier, then hit a dribbler back to Wilson for the third out.

"It was fun," Posey said of his at-bat against Wilson. "You look for challenges against good pitchers, and he's one of them. Obviously, it's different hitting instead of catching, but it looked like the velocity on his cutter and fastball were pretty close to where he always is."

"He got us out," manager Bruce Bochy said. "He did his job. He did a good job for us. I appreciate what Brian did for us, but he's on another club now."

Wilson did not speak at length to reporters, saying as he walked past them, "I didn't do anything."

Wilson would not have pitched had the Giants not ended closer Kenley Jansen's 18-save conversion streak with a ninth-inning run. Pablo Sandoval singled to start the inning and Gregor Blanco drove in pinch-runner Juan Perez with his third hit, a single.

Although the Giants lost, there were positives, most notably seven strong innings from Matt Cain, who might have had a shot to even his record at 9-9 had he not thrown a potential double-play ball into center field for an error that extended the inning and led to a Dodgers run in the second.

That error ended the Giants' 13-game errorless streak, which Elias reported was the longest in modern franchise history, dating to 1900.

The Dodgers took a 2-1 lead in the seventh inning on Yasiel Puig's two-out, RBI double on a first-pitch Cain fastball. Bochy could have walked Puig intentionally and had lefty Javier Lopez face the next hitter, Carl Crawford. But Cain was throwing so well - with tremendous life on his fastball - that Bochy did not hesitate to stick with his starter.

"We've got our guy out there," Bochy said. "His pitch count was good and he was throwing well."

Bochy ordinarily does not throw pitchers just off the disabled list into situations as he did with Affeldt in the 10th. But Bochy did not hesitate there, either, with three Dodgers lefties due up among the next four hitters.

"He was ready to go," Bochy said. "He faced hitters. We even did an extra session for him to see if he's ready. He's one of our setup guys. They threw some pretty good at-bats out there."