SAN FRANCISCO (AP) -- Brandon Webb enjoys matching up with other major league aces, especially when Arizona gets the win.
Webb struck out eight to pass 1,000 for his career and got the win in a matchup with fellow All-Star right-hander Tim Lincecum, leading the Diamondbacks to a 5-3 victory over the San Francisco Giants on Saturday night.
Webb allowed three runs and four hits in seven innings, winning his third straight decision to become the second pitcher in the majors with 14 victories.
He managed to get a few words out of the usually reserved Lincecum when both were in New York this month for the All-Star festivities.
"He was a couple of lockers down from me but he didn't say too much," Webb said. "It was more like, 'Hey, what's up?' some chitchat here and there. It's always fun to play in these kinds of close games."
Lincecum had a career-high 13 strikeouts in seven innings, and left with a 3-2 lead.
Chris Young and Conor Jackson each drove in runs against Tyler Walker (3-6) in Arizona's three-run eighth. Young's sacrifice fly tied it at 3, and Jackson singled in Stephen Drew to give the Diamondbacks the lead.
"When you give up a leadoff double you're asking for trouble," Walker said. "It's frustrating because we battled back against one of the best pitchers in the league. I let the team down."
Webb (14-4) became the 57th active pitcher with 1,000 Ks when he struck out Dave Roberts in the third inning. He now has 1,008 for his career.
"I was able to get my pitch count under control by being more aggressive," Webb said. "Roberts always battles me pretty good and I end up walking him twice. He scored both times too. I pitched around some trouble and tried to stay in there for as long as I could."
Webb has won seven straight decisions against the Giants, and hasn't given up a home run to a San Francisco hitter since Moises Alou in April 2006, a span of 62 innings.
Webb's 12 wins against the Giants are his most versus any team and his six wins in San Francisco are his most outside of Arizona.
"He's pretty economical with his pitches and that's why we can leave him out there an extra inning to pick up a win," Diamondbacks manager Bob Melvin said. "Both guys pitched great and there were big hits on both sides."
Chris Snyder had two hits and drove in two runs for the Diamondbacks, who have won four of five to climb one game over .500 for the first time since June 30. The Diamondbacks have won eight of their last 12 against the Giants.
Lincecum struck out the side twice and recorded two strikeouts in three other innings. He got Drew three times.
"I'm more concentrating on the task at hand," Lincecum said. "I'm not out there worrying about my strikeout totals or anything while we're in a game like that -- especially a close one. It's more, 'Let's get out of these innings, let's get our bats going.' That's pretty much what I was trying to do."
Lincecum did not walk a batter and was helped by his defense nailing two Diamondbacks at the plate. Alex Romero, who recorded his first major league triple, was thrown out trying to score on an infield grounder in the third and Snyder was cut down trying to score on a single to center to end the fifth.
"Early on he was dominating," Melvin said. "But our bats got better as the game went along, no question."
Joe Rauch threw a perfect eighth and Brandon Lyon pitched the ninth for his 21st save in 26 chances, finishing the five-hitter.
Aaron Rowand had two hits and drove in two runs for the Giants, who fell to 4-11 in their last 15 games.
The Diamondbacks are now 4-34 when trailing after the seventh inning. ... Lincecum recorded 10-plus strikeouts for the sixth time. ... Arizona is 24-12 against the NL West. ... Jackson is hitting .485 (16-33) with three home runs and seven RBIs since the All-Star break.