CHICAGO -- Angel Pagan hit a line-drive RBI single to center field in the top of the ninth inning to break a 5-5 tie, and the San Francisco Giants went on to beat the Chicago Cubs 7-5 at Wrigley Field on Sunday, taking two of three in the series.
The Giants also got and run-scoring single in the ninth from Marco Scutaro.
The tie-breaking hit came off Cubs closer Carlos Marmol (2-3), who got himself into trouble with a pair of walks. Pagan's hit scored pinch runner Gregor Blanco.
San Francisco, the first-place team in the National League West, improved to 76-58 while Chicago fell to 51-82.
The victory went to Giants reliever Santiago Casilla (6-5). The save went to Javier Lopez, his sixth.
The Giants jumped to a 3-0 lead against Cubs left-hander Travis Wood in the third inning, with two of the runs being unearned.
With one out and Xavier Nady on first base, pitcher Matt Cain bunted toward first baseman Anthony Rizzo, whose throw to first pulled Darwin Barney off the bag for a throwing error, putting runners at first and second.
Pagan followed with an RBI single. After Scutaro popped out, Pablo Sandoval and Buster Posey each hit run-scoring singles. Wood wound up throwing 35 pitches in the inning.
The Cubs scored one in the third on an RBI single by David DeJesus. In the fifth, they scored four runs, capped by Alfonso Soriano's 25th home run of the season, a three-run blast to left-center field.
This is Soriano's fourth season of at least 25 home runs with the Cubs, making him the 10th player in franchise history to do that.
Cain worked five innings, giving up six hits and five runs while walking two and striking out six. Wood pitched 5 2/3 innings, allowing seven hits and four runs, two earned, while walking one and striking out two.
NOTES: The schedule has not been kind to the Giants. They played a day game Friday at Wrigley Field after a night game Thursday in Houston. Remnants of Hurricane Isaac hit parts of the Chicago area over the weekend but spared Wrigley Field. The Giants play Arizona in San Francisco Monday afternoon, and manager Bruce Bochy was glad there were no postponements. "This is a tough schedule to come in here, short night, if we hadn't gotten (Saturday's) game in, it would have really made it tough." ... The Cubs recalled right-handed reliever Miguel Socolovich from Class AAA Iowa. They claimed him off waivers from Baltimore Aug. 23 after the Orioles had designated him for assignment ... Nady hit a three-run double Saturday in his first at-bat with the Giants, who purchased his contract before the game from Class AAA Fresno. Before Nady, the last Giant with three RBIs in his first at-bat with the team was Candy Maldonado against Houston on April 8, 1986. Nady was designated for assignment by Washington July 21 ... Chris Rusin will be recalled from Class AA Tennessee by the Cubs to start Tuesday night in Washington. Rusin made one start for the Cubs, losing 5-2 at Milwaukee on Aug. 21.