SAN FRANCISCO -- The Giants endured a sinking feeling in more ways than one Tuesday night as they lost to the Chicago Cubs, 8-6.

They sensed the deflation of watching Tim Lincecum display the vulnerability that has plagued him at least once in every month since April. In one of the worst performances of his career, Lincecum allowed six runs in four innings as his ERA climbed from 3.15 to 3.41.

San Francisco also slipped in both the National League West and Wild Card standings. San Diego's victory over Pittsburgh lengthened its division lead over the second-place Giants to 2 1/2 games. And the Giants also lost sole possession of the top spot in the Wild Card race after maintaining it for 19 days, falling into a tie with Cincinnati at the head of the pack.

The Giants tried their best to avoid their fifth loss in seven games. Facing deficits of 4-0, 6-2 and 8-4, they rallied each time as Buster Posey collected four RBIs in a 3-for-5 effort. But while the Giants matched Chicago's 14 hits, two more double-play grounders muted their offense.

In what may have been the evening's most positive development for the Giants, Pablo Sandoval emerged from his season-long slump to record his first three-hit game since July 17 and only his second such performance since June 1.

"I don't care about the season for me," Sandoval said. "I only care about getting the team to the playoffs."

That will become a daunting task if Lincecum (11-6) continues groping for his form. Entering the season's stretch drive with an ineffective ace would be a nightmare for the Giants, though manager Bruce Bochy tried to allay fears.

"We need all of the guys at the top of their game," Bochy said. "I think Tim will bounce back."

Searching for consistency with his delivery, Lincecum allowed four first-inning runs -- the most he ever has yielded in the opening frame -- and abandoned the hands-over-the-head windup he began employing two starts ago.

Pitching mostly from the stretch, Lincecum retired 10 of 11 batters after Kosuke Fukudome's two-run homer punctuated the Cubs' first-inning outburst. But he surrendered a pair of runs after he had two out and nobody on base in the fourth -- a telling lapse, given the Giants' repeated comebacks.

"It's still something I'm working on," Lincecum said of his modified windup. "Obviously I wasn't feeling comfortable with it today, which is frustrating."

In his between-starts throwing session and simply by concentrating on his delivery as he plays catch, Lincecum will determine whether he sticks with his new windup, reverts to the one that helped him win the last two National League Cy Young Awards or pitches from the stretch.

"You don't find consistency by not picking up a ball," he said. He indicated that he might consult his father, Chris, who helped him develop his pitching mechanics, though for simplicity's sake the younger Lincecum has been increasingly trying to monitor himself.

Remaining confident also is part of that process.

"Just know that you're going to come out of it and not to get too down about it," said Lincecum, noting that he feels fine physically. "Everybody in here has high expectations of themselves, and when things like that happen, you kind of wear it. It's about bouncing back and staying mentally strong."

Still, placing Lincecum's outing in perspective is startling. He has yielded more than six runs just once in his 114-game career. As a rookie on June 13, 2007, he lasted 3 2/3 innings against Toronto and was responsible for all of the Blue Jays' scoring in a 7-4 loss. He allowed six runs for the second time this season -- the other lapse occurred in a 4 2/3-inning stint on May 26 in a 7-3 loss to Washington -- and for the fifth time in his career. But the other three instances occurred in 2008 or earlier.

Lincecum has lasted less than five innings in four games this year. That happened twice last season.

The Cubs' four first-inning runs matched the number of runs he allowed in the first innings of his 32 starts last year. Entering this game, Lincecum's career first-inning ERA was 2.09, his best of any inning.

Cubs starter Ryan Dempster (10-8), who yielded four runs (three earned) and eight hits in 6 2/3 innings, appreciated his teammates' effort.

"I was able to make some pitches in situations and get out of jams," Dempster said. "More important, these guys came out and put a four-spot up against Lincecum and that's not an easy thing to do. They came out swinging the bats great."