ATLANTA -- A visit by the struggling Chicago Cubs was just what the Atlanta Braves needed to get out of their own funk.

Aaron Harang, who struck out nine over six innings, was backed by homers from Evan Gattis and Jason Heyward as the Braves completed a three-game series sweep with a 5-2 victory Sunday before 26,151 at Turner Field.

The Braves, who were mired in a seven-game losing streak less than a week ago, are 21-15 and lead the National League East.

The loss, meanwhile, was the Cubs' seventh in the past eight games and dropped them to 12-24, including 5-13 on the road.

Catcher Gattis hit a bases-empty homer off Cubs starter Edwin Jackson in the fourth inning and right fielder Heyward connected with a runner on in the seventh inning against reliever James Russell.

The Braves, who had lost eight of nine games, defeated the Cubs 3-2 in 10 innings on Friday and then won 2-0 on Saturday despite just two hits over the first six innings against hard-luck Cubs starter Jeff Samardzija.

Harang (4-3) allowing two runs on six hits and a walk. The right-hander retired nine of the last 10 batters he faced, striking out five, and left after 107 pitches.

Jackson (2-3) gave up six hits and three runs in six innings, the right-hander striking out three and walking two.

The Braves ran themselves out of a chance for a bigger inning, but still staked Harang with a two-run lead in the second. Jackson gave up a walk and three hits in the inning, with left fielder Ryan Doumit and shortstop Andrelton Simmons getting the RBIs on a single and double, respectively.

The Cubs tied it in the fourth inning on a two-run double by right fielder Nate Schierholtz only to have the Braves quickly regain the lead in the bottom of the inning. Gattis picked on a first-pitch fastball from Jackson and sent a towering drive to left-center field for his eighth homer of the season.

Heyward connected with a 3-2 slider from left-hander Russell and sent a no-doubt blast into the Braves bullpen in right-center field. It was the left-handed hitter's third homer of the season and came after Russell had hit pinch hitter Dan Uggla leading off the inning.

David Carpenter pitched a perfect ninth inning to record his second save as center fielder B.J. Upton made a sliding catch to end the game.

NOTES: Braves 3B Chris Johnson had two hits and is 10-for-19 in his past five games, lifting his average to .279. ... Braves LF Justin Upton, who left in the sixth inning Saturday after being hit by a pitch, was out of the lineup Sunday. He is listed as day to day with a lower-back muscle contusion. ... The Braves open a three-game series in San Francisco on Monday, while the Cubs continue their road trip with four games in St. Louis. ... Braves manager Fredi Gonzalez put the pitcher eighth in the batting order for the sixth consecutive game. ... RHP Gavin Floyd, who pitched seven strong innings in his return from Tommy John elbow surgery in a no-decision against St. Louis on Tuesday, will make his second start for the Braves. ... The Braves swept a three-game home series from the Cubs last year during the first weekend of the season and finished 5-1 overall against them. The teams play in Chicago on July 11-13.