Updated

Angel Pagan and Marco Scutaro hit back-to-back RBI singles in the top of the ninth inning, lifting the San Francisco Giants to a 7-5 win over the Chicago Cubs in the rubber match of a three-game set at Wrigley Field.

Chicago closer Carlos Marmol (2-3) was asked to keep the game tied at five and promptly walked Xavier Nady to begin the ninth. Pinch-runner Gregor Blanco then stole second and Brandon Crawford worked a one-out walk before Pagan delivered with a base hit to center field. Scutaro followed with another run- producing hit to give the Giants more breathing room -- the NL West leaders had blown a three-run advantage earlier in the game.

"That's a championship, first-place club putting those at-bats together," said Cubs manager Dale Sveum.

Santiago Casilla (6-5) gave up a one-out single to Darwin Barney in the bottom of the ninth. When Bryan LaHair was announced as a pinch-hitter, left-hander Javier Lopez was summoned from the bullpen.

Sveum countered with Joe Mather, but the move proved fruitless when Mather grounded into a game-ending double play.

"That's what you always try to do is take the series. That's how you have a good year," said Giants manager Bruce Bochy.

David DeJesus drove in the Cubs' first run with a single in the third off San Francisco starter Matt Cain and ripped another base hit with a man aboard in the fifth. Right fielder Hunter Pence bobbled the ball, enabling Darwin Barney, who had singled and advanced on a sacrifice bunt, to score.

Luis Valbuena followed with a walk before being erased at second on a fielder's choice. Alfonso Soriano then put Chicago on top by launching Cain's 1-0 offering over the wall in left-center for a three-run homer.

The Giants came right back in the sixth, tying the game with a two-out rally. Chicago starter Travis Wood was removed after Nady kept the inning alive with a double to right. Pinch-hitter Brandon Belt greeted Wood's replacement, Manuel Corpas, with an RBI triple to left and wound up scoring on a wild pitch from the Cubs reliever.

A defensive miscue by the Cubs aided in the Giants grabbing a 3-0 lead in the third.

Cain dropped down a sac bunt with one out, but reached on a throwing error by first baseman Anthony Rizzo. Pagan then knocked in Nady, who had drawn a leadoff walk, with a single to left. Wood retired the next batter, but Pablo Sandoval and Buster Posey both contributed RBI singles.

Game Notes

The Giants haven't lost a road series since dropping two of three games at Pittsburgh from July 6-8 ... Soriano became the 10th player with at least four 25-homer seasons as a Cub.