SAN FRANCISCO -- With Arizona's hitters mired in a slump, Doug Davis didn't expect much offensive support from his teammates.
The Diamondbacks left-hander didn't need much and got just enough.
The runs snapped a 20-inning scoreless streak for the Diamondbacks, who have been shut out twice and held to two runs or less in seven of their 11 games.
"It's frustrating and I'm not the only one in here that's frustrated," Davis said. "All of our hitters are frustrated and you can see it. It can't last forever. I know they're going to come out and be a little more consistent."
Davis scattered eight hits and struck out six while pitching out of trouble all afternoon to earn his first win since Aug. 29, 2008.
Chad Qualls worked the ninth for his second save in three opportunities.
Young struck out twice against San Francisco starter Tim Lincecum, but jumped on a fastball from closer Brian Wilson and lined it down the left-field line for a double to drive in pinch-runner Eric Byrnes and Mark Reynolds.
"We'll take it," Diamondbacks manager Bob Melvin said. "It seemed like early in the game it was going to be tough for either team to score. As the game went along and the outs continued, it seemed like it was going to be one at-bat and a big hit that was going to win the game."
Young delivered one of the few big hits Arizona's had this season.
On Friday, starter Dan Haren allowed only one run in six innings but left with an 0-3 record after the Diamondbacks were shut out by four San Francisco pitchers.
Things didn't get any easier against Lincecum, the NL Cy Young winner. The Giants' right-hander has struggled this season while battling a stomach ailment but came through with his best outing of the year, pitching eight shutout innings and matching his career high with 13 strikeouts.
Lincecum allowed five hits and only two runners past first base.
"It's the nature of the game that once in a while the other team scratches out a win and sometimes you scratch out a win," said Lincecum, who gave up 14 hits and seven runs in his previous two starts. "I didn't have too many rough innings and didn't get my pitch count up. My landing point was off the last few outings and I just needed to figure out what I was doing wrong."
Lincecum didn't walk anyone and struck out Conor Jackson three times while getting Reynolds twice.
With no run support from his teammates, however, Lincecum failed to get his first win of 2009 and the Giants lost for the seventh time in eight games.
"That's the Timmy we know," San Francisco manager Bruce Bochy said. "He did his job. We squandered too many opportunities. We're sputtering offensively."
The Diamondbacks, who were stymied most of the afternoon, got going once Lincecum left the game.
Chad Tracy drew a one-out walk off Jeremy Affeldt and Reynolds followed with a single off Wilson. Byrnes pinch-ran for Tracy before Young's double to left helped end the Diamondbacks' two-game losing streak.
Davis, who attended high school in nearby Walnut Creek, methodically kept the Giants off balance, pitching out of jams with runners in scoring positions in six innings.
"Couldn't ask for anything more, except for nine innings," said Davis, who had about 20 friends and family attend the game. "I was getting ahead and I had a curveball today that I threw a lot. It was fun."
San Francisco got a runner to third twice and had four others reach second but Davis worked out of trouble each time.
Lincecum has now struck out at least 10 batters 12 times during his career. ... Giants' 2B Emmanuel Burriss was thrown out trying to steal home in the first inning. ... San Francisco LHP Randy Johnson (0-2) will pitch against Arizona on Sunday, the first time the Big Unit has faced his former team. Johnson pitched for the Diamondbacks from 1999-2004 and from 2007-08 before signing with the Giants this past offseason. ... Prior to the game the Giants ran a picture tribute on their outfield scoreboard memorializing the 103rd anniversary of the 1906 San Francisco earthquake.