"It's tough to sit here and feel good about your first half when you just lost the game," Dempster said. "It would have been nice to win that game and get a sweep and go into the All-Star break with a win. But, as a team, as a unit, we should be really proud of ourselves and what we did in the first half and build off that. We have to go out there and continue to do exactly the same thing in the second half."
Lincecum (11-2) struck out nine and scattered six hits over eight innings, including an RBI double in the fourth by Jim Edmonds. It was the lanky right-hander's second straight win over the Cubs; he also picked up a win July 3 in San Francisco.
"He's a good pitcher," Chicago's Mark DeRosa said. "He doesn't just attack you with heaters and let you get comfortable. He mixes a lot of stuff in there."
Dempster (10-4), one of a franchise-record eight Cubs headed to Tuesday's All-Star Game, lost at home for the first time in 12 starts. He had entered the game a perfect 10-0 at Wrigley Field, but gave up four runs, seven hits and three walks over 6 2/3 innings. It's the second time in his dozen home starts that he served up four runs.
"I definitely wanted to keep that going," Dempster said of his perfect record at home. "Hey, it was a tough one, a tough matchup. He's not going to give up a lot of runs. Unfortunately, I gave up a crooked number in that inning. We had a shot at the end, but it didn't happen."
The Cubs did threaten in the eighth when they had two on and one out, but Lincecum got Aramis Ramirez to hit into a double play. In the ninth, Geovany Soto slapped a pinch-hit RBI single, but Giants closer Brian Wilson struck out Daryle Ward and got Ryan Theriot to ground out.
"We faced San Francisco's two All-Star pitchers," Cubs manager Lou Piniella said. "They pitched like it, so give them credit."
Lincecum hit his RBI triple with one out in the third, the ball bouncing past a charging DeRosa in right. Fred Lewis walked, and one out later, Ray Durham hit a two-run single to go ahead 3-0. Lewis also hit an RBI triple in the seventh.
"The base hit by their pitcher set up the inning for them," Piniella said. "Dempster has had a good first half -- what is he, 10-4? We'll take another 9-3 the rest of the way and everybody will be happy."
Dempster threw 118 pitches Sunday, and whether he can go Tuesday will be up to NL All-Star manager Clint Hurdle. The Cubs right-hander wants to pitch. In 2000, the only other time Dempster was named to the All-Star team, he did not appear in the game other than introductions.
"It's a blessing," Dempster said about being selected. "It's one of the best honors you can have, to go there and represent your team. I'm honored to be going. Hopefully, I get an opportunity to contribute in some way."
Piniella was named to the NL coaching staff, and said he'll be a "leisure coach." That's not a bad assignment. Most of the Cubs -- including reliever Carlos Marmol, who was named to replace Kerry Wood on Sunday -- were traveling together.
"We're all taking a huge hot air balloon on the way over," Dempster said. "It'll be pretty nice."