Given a rare day out of the starting lineup, Torres finished the job and sent the Giants into their weekend showdown with San Diego on a high note.
Pat Burrell homered twice before Torres' bases-loaded single in the bottom of the ninth inning bailed out a bullpen that blew a four-run lead in the Giants' 8-7 victory over the Chicago Cubs on Thursday.
"He's a pretty good pinch-hitter to have in that situation," manager Bruce Bochy said. "That's a good win when a team comes back from four runs down and ties it on you."
Burrell hit a grand slam and solo home run and Pablo Sandoval also homered to snap a drought of 178 at-bats without a longball before Torres ended it with his third game-ending hit of the season.
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 for the first time since July 15 before 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.
"I was ready all the time," Torres said. "I was in the cage stretching, hitting off the machine to be ready. Pablo told me, 'You're going to do something. You're going to finish this game."'
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.
"It's definitely a big series," starter Matt Cain said. "Obviously we're one and two. We have to play well. We'll take the energy we've had in the past couple of games into that one."
Burrell gave the Giants a 7-3 lead with a grand slam in the fifth off Randy Wells. But the Cubs worked their way back into the game after Cain left.
Kosuke Fukudome 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 Jeff 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.
But the Cubs were unable to add another run and lost for the 14th time in 17 games.
"We battled back but it's the same story, same script we've been talking about here and it just makes it very difficult," said acting Cubs manager Alan Trammell, filling in while Lou Piniella is helping his ailing mother in Tampa, Fla.
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.
Chicago dropped three of four in this series, losing them all by one run. The Cubs are 13-29 in one-run games this season, the most losses in the majors.
"It's not tough, it's just not fun at all," outfielder Marlon Byrd said. "You get sick and tired of losing. One run games, 10 run games, it just gets old."Notes
- 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.
- Piniella is also expected to rejoin the team in St. Louis.