Updated

Aramis Ramirez had three hits and two RBIs, Tom Gorzelanny pitched seven strong innings and the Chicago Cubs held on to beat the Atlanta Braves 5-4 on Saturday.

The win didn't come without another scare for the Cubs. Reliever Sean Marshall entered with the bases loaded and one out in the eighth inning. After striking out pinch-hitter Melky Cabrera, Brooks Conrad followed with a long fly off the center-field ivy. Derrek Lee and Alex Gonzalez came around to score. David Ross was held at third but was waved in when shortstop Starlin Castro dropped the relay throw for an error to make it 5-4.

Marshall intentionally walked Omar Infante and hit Jason Heyward with a pitch to load the bases again. But he ended the inning by getting Martin Prado to ground out to shortshop.

After giving up a three-run triple to Rick Ankiel in the ninth in Friday's loss, Cubs closer Carlos Marmol pitched a scoreless ninth for his 22nd save in 27 opportunites.

Gorzelanny (7-7) allowed one run and seven hits. He struck out nine, walked two and retired the final six batters he faced after giving up an RBI double to Alex Gonzalez in the sixth inning.

Heyward had two hits for the NL East-leading Braves, who lost for just the third time in 11 games.

The Cubs ended an eight-game skid at home and won just for the second time at Wrigley Field this month.

Braves starter Tommy Hanson (8-9), who came into the game with a 1.93 ERA in eight starts since July 9 despite going winless in that span, allowed five runs, four earned, and seven hits. He struck out four and walked four. He is 0-4 in his last nine starts and has not won since July 3 against Florida.

Kosuke Fukudome led off the first inning with a double into the left-center gap. With two outs, Ramirez lined a single to left. Fukudome scored from second as left fielder Matt Diaz's throw was cut off by third baseman Martin Prado. Prado then had a chance to get Ramirez trying to take second on the throw, but Prado's throw was off the mark and the ball wound up in center field allowing Ramirez to advance to third.

Tyler Colvin followed with a hit to second baseman Omar Infante, Infante fielded the ball in the outfield grass and his late throw went over the head of Derrek Lee at first as Ramirez scored.

In the third inning, Hanson issued back-to-back walks, then Ramirez hit a broken-bat RBI single and Colvin followed with another run-scoring single. Blake DeWitt added an RBI hit to give the Cubs a 5-0 lead.

NOTES: On Friday, Braves manager Bobby Cox wasn't sure that Cubs manager Lou Piniella was ready to call it quits after the season. But before the game, Piniella confirmed he's done managing after the season. "My circumstances have changed. I appreciate the fact that Bobby thinks I can still. But I'm convinced that when I take the uniform off here I'm going to be home and I'm going to enjoy my family and that's the end of it. There shouldn't be any more discussion about this because that's the way I feel," said Piniella, who missed four games earlier in the month to be with his ailing mother. ... Piniella expects C Geovany Soto to be activated from the DL on Sunday. He's been out with a sprained ligament in his right shoulder. ... Colvin finished with two hits and two RBIs.