SAN FRANCISCO -- Pinch-hitter Andres Torres hit a bases-loaded single in the bottom of the ninth inning to send the San Francisco Giants into a weekend showdown against San Diego on a high note following an 8-7 victory over the Chicago Cubs on Thursday.
Aaron Rowand led off the ninth with an infield single against Andrew Cashner (1-5) and went to second on a sacrifice by Freddy Sanchez. After Aubrey Huff was intentionally walked, Cashner walked Buster Posey unintentionally to load the bases.
Torres, held out of the starting lineup because of tightness in his legs, then hit a drive to center that landed on the warning track and bounced over the fence for the winning hit.
Brian Wilson (3-1) pitched a hitless ninth for the win.
Now the Giants can turn their attention to the NL West-leading Padres, who have won seven of eight head-to-head meetings between the teams this season. But the Giants are a very different team than the one that last played the Padres in May.
The biggest difference is the presence in the lineup of rookie Buster Posey, who is hitting .335 since being called up from the minors May 29, and Burrell, who has 10 homers in 154 at-bats since joining the Giants on June 4.
San Francisco can take over first place in the NL West by sweeping the three-game series at home beginning Friday.
Kosuke Fukodome hit an RBI double in the seventh off Chris Ray before Chicago scored three times in the eighth to tie it. Blake DeWitt started the rally when he drew a leadoff walk from Javier Lopez. Guillermo Mota allowed a single to Geoff Baker and an RBI double by Koyie Hill to make it 7-5.
Sergio Romo entered with runners on second and third and no outs and got pinch-hitter Alfonso Soriano on an infield popup and Tyler Colvin on an RBI groundout. Starlin Castro then tied the game with an RBI single past a diving Sandoval at third base for his fourth hit of the game.
Cain matched a season-high with nine strikeouts in six innings, but was not as dominating as usual against the Cubs. Cain had allowed just one run in his past 30 innings against Chicago, throwing 23 straight scoreless innings since new teammate Mike Fontenot hit an RBI single against him Aug. 23, 2007.
Cain couldn't make it out of the first inning unscathed this game, giving up a two-run double to Xavier Nady that put the Giants in an early hole.
Wells' RBI double in the fourth made it 3-1 before the Giants tied the game on the consecutive homers by Burrell and Sandoval.
Sandoval's homer was first since June 15 against Baltimore and his third career splash hit. ... Burrell has 19 career multihomer games. ... Cubs 3B Aramis Ramirez missed his second straight game with a sore left rib cage. ... Cubs 1B Derrek Lee will fly to St. Louis with the team and be activated from the bereavement list Friday. ... Cubs manager Lou Piniella, who is helping his ailing mother in Tampa, Fla., is also expected to rejoin the team in St. Louis.