SAN FRANCISCO -- Julio Borbon and Junior Lake scored on an error by San Francisco first baseman Brandon Belt in the ninth inning and the Cubs rallied for a 3-2 win over the Giants on Friday night.
Borbon singled leading off the inning against Giants closer Sergio Romo (3-5) and moved to second when pinch-hitter Dioner Navarro walked.
After David DeJesus struck out looking, Lake reached on a fielder's choice. Anthony Rizzo then hit a sharp liner that went through Belt's legs and into the right field corner.
The Cubs, who earlier in the day completed a trade sending slugging outfielder Alfonso Soriano to the New York Yankees, rallied for just the fourth time when trailing after eight innings.
Jeff Francoeur had two hits for the Giants, who lost for the fifth time in six games.
Matt Guerrier (4-4) retired four batters for the win while Kevin Gregg worked the ninth for his 20th save.
Chicago's 14th come-from-behind win came after Francoeur's two-run single off starter Edwin Jackson in the seventh gave the Giants a 2-1 lead.
The wild ending was in stark contrast to the pitching duel between Jackson and San Francisco starter Matt Cain.
Jackson faced just one batter over the minimum through four innings and carried a two-hit shutout into the seventh until giving up two walks and a double before Francoeur's two-run single.
Cain allowed six hits, struck out seven and walked one and was in line to win consecutive starts for the first time since early May until Romo's fourth blown save following the Giants' NL-leading 74th error.
The Cubs won only hours after the club completed the Soriano deal with the Yankees. Earlier this month, the team also traded pitcher Matt Garza to Texas and pitcher Scott Feldman to Baltimore.
Cubs manager Dale Sveum said he isn't sure if the team is done making moves, but doesn't want it to become a distraction.
"I'm not exhaling yet," Sveum said before the game. "I don't really see anything else happening but until that 11th hour is here, I don't think you can relax. We don't dwell on it anyway."
Nate Schierholtz, batting in the cleanup spot with Soriano gone, doubled and scored Chicago's first run to continue a strong stretch for the Cubs slugging right fielder. He went 1 for 3 and is batting .428 (9 for 21) on the road trip.
Pablo Sandoval and Hunter Pence both doubled and scored for San Francisco, which dropped a season-high 10 games below .500 with the loss.
Sandoval walked with one out in the seventh and took third on Pence's double. After Belt was intentionally walked to load the bases, Francoeur blooped a two-run single that landed in between second baseman Darwin Barney and right fielder Schierholtz to give the Giants a 2-1 lead. Belt was tagged out trying to score.