SAN FRANCISCO (AP) -- Matt Cain had been thinking a lot about this outing and how much he needed to bounce back with a great start. Then he went out and pitched one of his best games yet in 2008.
"I found a good rhythm in the bullpen," Cain said. "It was definitely something that was very much needed. Coming into this start I was anxious to get it going."
Fred Lewis stole home, scored both runs and had the first two hits against Chicago starter Jason Marquis to help Cain's winning cause. The Giants went ahead 1-0 in the first when Lewis scored on a double steal in which Randy Winn stole second, and San Francisco bounced back to end a three-game home losing streak after the Cubs took the series opener 9-2 on Monday night.
Manager Bruce Bochy stuck with Cain (5-6) in the eighth even with his pitch count already over 100, and Cain matched his season high with eight innings in his team-leading 18th start. He allowed a single to No. 3 hitter Derrek Lee in the first and didn't surrender another hit until Daryle Ward doubled to start the seventh.
"He was on," Bochy said. "That's a great effort."
Cain, who had lost two of last three outings and three of five, put his strikeout total over 100 with his second 10-strikeout performance of the year and sixth of his career. Cain, Tim Lincecum and Jonathan Sanchez each have 100-plus Ks, the first time in San Francisco history three pitchers have reached the mark before the All-Star break.
Cain allowed two hits and walked three in an efficient 114-pitch performance. Castillo ended the eighth by diving to his left to stop Mark DeRosa's hard-hit ball and then firing to first for the out. Even 11-time Gold Glove shortstop Omar Vizquel, who had a perfect view of the play only several feet away, was left shaking his head in awe.
"It's a reaction play," Castillo said. "Omar said to me, 'That's the play of the game.' I said, 'That's my job.'"
DeRosa went 0-for-4 a night after hitting a grand slam and a two-run homer to match his career high of six RBIs.
"It was a well pitched game. Their guy pitched well and so did ours," Cubs manager Lou Piniella said. "Jason gives up two runs, four hits, goes seven innings. I'll take that every time. We had a few chances, not too many, and didn't get it done."
Brian Wilson recorded the final three outs for his National League-leading 23rd save in 25 opportunities, but not before allowing Lee's leadoff triple in the ninth and Geovany Soto's RBI single two batters later. Lee was the first Cubs baserunner to reach third all game.
Wilson, who reached 100 on the radar gun, has acknowledged he enjoys pitching with added pressure like that he faced Tuesday -- and after the triple and run told himself that was it and preserve the game at 2-1. The last thing he wanted to do was spoil Cain's special night.
"That's the epitome of pitching," Wilson said of Cain. "That's the Matt Cain I remember when I was called up in '06."
Marquis (6-5) wasn't bad himself over seven strong innings.
The right-hander had his four-start winning streak snapped in his previous outing June 26 against Baltimore, but pitched well enough to win in this one. He allowed a leadoff single in the first to Lewis but not another hit until Lewis doubled to start the sixth, retiring 13 straight between Lewis' two hits. After Lewis doubled, Winn singled him home two batters later.
"Matt threw the ball real well. His talent speaks for itself," Marquis said. "They grabbed the run early and the defense made some great plays to keep it right there. Sometimes your offense will get shut down. It happens. I felt great."
Marquis allowed two runs, four hits, struck out five and walked three.
Cubs shortstop Ryan Theriot was a late scratch with the stomach flu. He later entered as a defensive replacement and struck out to end the game against Wilson, his former college teammate at LSU.
The Cubs will welcome back Carlos Zambrano from the disabled list to start Friday at St. Louis. He has been out with a right shoulder strain. "He threw today and he threw very well," Piniella said. ... OF Alfonso Soriano, sidelined with a broken left hand, will return to Chicago on Thursday to be examined and get X-rays and if his bone structure is OK he will be cleared to start taking batting practice this weekend in St. Louis. ... ... San Francisco OF Dave Roberts (left knee surgery) has been running the bases for several days and is scheduled to report to Triple-A Fresno on Friday to begin a rehab assignment. He is expected to rejoin the Giants after the All-Star break if all goes well, but Bochy expects he will need 45-50 at-bats in the minors before then. ... Lewis stole home for the first time in his career, in his second attempt of the year. Vizquel stole home against the Oakland Athletics last month.