SAN FRANCISCO -- Tim Lincecum's downward spiral is taking San Francisco's playoff hopes along for the ride.
The winner of the past two National League Cy Young awards, Lincecum gave up four runs on five hits in six innings in his latest setback and has a 7.82 ERA in August.
"I'm pretty ready for [September]," Lincecum said. "This has been one of those things you have to take with a punch and just roll with it. It's not fun to go through. You have to fight through it. The last thing I want to do is give up or give in to what's going on now."
Lincecum (11-9) has tried just about everything to break his slump but hasn't had much luck.
The right-hander wore striped stirrups for the first time this season but opened the game with a four-pitch walk to Drew. He struck out the next two batters, then walked Chris Young before LaRoche homered on a 1-2 pitch into McCovey Cove.
The Diamondbacks tacked on another run off Lincecum in the third when Drew tripled and scored on Justin Upton's sacrifice fly.
Since opening the season 5-0 with a 1.76 ERA, Lincecum has struggled more than at any other time in his career. He hasn't won since July 30 and is 6-9 with a 4.80 ERA over his past 19 starts.
"He was having trouble getting settled in," San Francisco manager Bruce Bochy said. "It was very encouraging to see how he finished up and he threw the ball very well. That counts too. Unfortunately we didn't have the bats going tonight to make up for it."
The loss dropped San Francisco a half-game behind Philadelphia in the NL wild-card race. The Giants are six games behind San Diego in the West.
Barry Enright and two relievers combined on a seven-hit shutout for the Diamondbacks, who snapped a seven-game losing streak to the Giants.
Enright secured 157 tickets to the game for family and friends, who made the 80-mile trek to see the Diamondbacks hand Lincecum his latest loss.
"There were quite a few people here and I heard a few cheers when I went out," said Enright, who struck out four and walked two. "It was a pretty cool homecoming. Obviously I had nerves, maybe even more so knowing everyone's here."
Stephen Drew doubled, tripled and scored three times for the Diamondbacks, who entered the night with the third-worst record in baseball. Arizona lost nine of its previous 13 games before jumping on Lincecum and the Giants early.
LaRoche provided the big hit with a three-run homer off Lincecum in the first inning, his 22nd of the year. LaRoche is batting .326 with eight home runs in August and needs six RBIs to break the franchise record for first basemen.
"When you get in a hole like that in the first inning, obviously it puts your defense and your offense trying to fight back," Lincecum said. "It's a tough situation to be in. Just one pitch."
While Lincecum was struggling, Enright was stellar in his second start against the Giants this season.
He pitched out of a two-on, one-out jam in the third and got plenty of backing from Arizona's defense. The Diamondbacks turned a 3-6-1 double play in the second, and left fielder Gerardo Parra made a diving catch on Pat Burrell's sinking line drive in the fourth.
San Francisco put two runners on base again in the fifth but Enright (5-2) struck out Buster Posey.
"He's had many games like that throughout the year," Arizona manager Kirk Gibson said. "He had a lot of pressure on him because he was going against Lincecum and I think he had like 200 people he left tickets for. As he has shown before, he handles that type of pressure very well."
Enright scattered six hits over seven innings with four strikeouts and two walks for Arizona, which had lost six straight at AT&T Park.
Arizona scored twice in the ninth on Kelly Johnson's second double of the night. Johnson finished 3-for-5.
Posey left the game in the eighth inning with a mild left forearm strain and is day to day. ... Enright has pitched at least five innings and allowed fewer than three runs in each of his 11 starts this season. ... LaRoche's homer off Lincecum is the second time he's homered into McCovey Cove off the Giants' ace. ... The Giants lost for the second time in 11 games while wearing their orange jerseys this season. ... San Francisco 2B Freddy Sanchez was charged with an error in the ninth inning when he bobbled pinch-hitter Ryan Roberts' grounder. It's Sanchez's first error since Sept. 19, 2009. ... Sanchez is 11-for-15 over his past four games. ... Drew's past nine hits have all gone for extra bases.