SAN FRANCISCO | Travis Wood did more than just pitch his way out of trouble.
He also hit his way to victory.
Wood pitched a four-hitter over seven innings and had a home run among his two hits in helping the Cubs complete a three-game sweep in San Francisco for the first time in 20 years, beating the Giants 2-1 Sunday.
"He threw one in there and I was able to put a good swing on it and hit it out of the park," Wood said. "I'm always surprised. I'm not trying to hit home runs."
Welington Castillo also homered for the Cubs, who won their third straight and five of seven despite playing without Alfonso Soriano, who was traded to the New York Yankees on Friday.
"It's tough to lose him," Wood said. "He was the leader of this team, he's been here the longest and he was swinging a hot bat. Guys just have to step up and fill in."
The Cubs' clubhouse broke into spontaneous cheering when Soriano homered for the Yankees and later learned of his game-winning hit.
"He's our boy," Castillo said. "He just needs to keep doing what he's been doing."
For one series, at least, the Cubs found a way to win without their popular ex-teammate.
Pablo Sandoval drove in a run for the Giants, who have lost four straight and seven of eight.
Tim Lincecum (5-11) had two hits in addition to pitching seven innings. He gave up two runs and four hits. He walked two and struck out a season-high 10.
"Tim did a great job," Giants manager Bruce Bochy said. "Not only did he pitch well, he got a couple of hits there. It's a shame he couldn't get him the win.
"In all my years I've never seen a team go through such a hard time getting runs in like we're having right now. It's a shame because we're getting such great pitching."
Wood (7-7) allowed an unearned run while walking four and striking out seven. Wood was 1-4 over his previous nine games. He's been involved in 10 one-run decisions.
"Early on it was kind of a grind but it was that way for both of us," Wood said. "I was able to settle down quite nicely."
Pedro Strop threw a scoreless eighth, his 12th consecutive scoreless outing (10 2-3 innings) since joining the Cubs on July 2.
Kevin Gregg recorded the final three outs for his 22nd save in 25 chances, and his third straight of the series.
Wood ended the scoreless tie with his third home run, a solo shot with two outs and on a 2-2 count, in the fifth. It was the first career home run Lincecum has allowed to an opposing pitcher.
Lincecum survived a shaky start to retire 13 of 14 batters until Wood took him deep.
"It was just a couple of location mistakes," Lincecum said. "Except for the two home runs everything seemed to come out of my hand better."
The Giants left the bases loaded in the third and had the bases loaded with no outs in the fifth. Buster Posey's grounder to Luis Valbuena turned into a 5-2 double play before Sandoval doubled to tie the game.
"Thank goodness we got another weird grounder to third we could turn into a double play," Cubs manager Dale Sveum said. "You don't see a force and tag like that too often."
Castillo hit his third home run with two outs in the seventh, giving the Cubs a 2-1 advantage.
"He was behind in the count and I was looking for a fastball," Castillo said. "He gave it to me."
The Giants, who have committed a major league-leading 76 errors, took fielding practice instead of batting practice before the game.