The Braves broke a 2-all tie with two runs in the sixth inning off rookie Shelby Miller (10-7) and two relievers. Pinch-hitter Joey Terdoslavich drove in Chris Johnson with the go-ahead run. Heyward added another run-scoring single.
Heyward has nine homers this season, including two in the series between NL division leaders.
Kris Medlen (7-10) allowed two runs on eight hits and a walk in six innings to snap his three-game losing streak.
Miller allowed three runs, two earned, on six hits and two walks in 5 2/3 innings.
The Braves finished their first three-game sweep of the Cardinals at Turner Field since April 22-24, 2003.
Atlanta relievers Luis Avilan, Jordan Walden and Craig Kimbrel combined for three scoreless innings. Kimbrel pitched a perfect ninth to take the NL lead with his 31st save.
The Cardinals were held to three runs in the series.
Johnson singled with two outs in the second, moved to third when the ball bounced past Carlos Beltran in right field for an error, and scored on a single by Andrelton Simmons. Heyward’s line-drive homer to the front row in right field pushed the lead to 2-0 in the third.
The Cardinals pulled even with two runs in the fifth. Back-to-back doubles by Pete Kozma and Miller produced the first run.
With two outs, Beltran hit a fly ball to left field that fell between Evan Gattis and Simmons. Gattis, a natural catcher, was playing deep for the power-hitting Beltran and was slow to break on the ball.
The Braves’ two-run sixth began with two outs. Johnson, who entered the night tied with Cardinals catcher Yadier Molina for the NL lead with a .332 batting average, singled for his second hit and moved to third on Simmons’ second single. Terdoslavich and Heyward followed with run-scoring hits.
Johnson added his third hit, a double, off Fernando Salas in the eighth to push his average to .338. Johnson scored on an infield hit by Reed Johnson and a throwing error by Kozma from shortstop.
Reed Johnson pulled up with an apparent injury after running to first and was replaced by pinch-runner Jose Constanza.
The Braves made two strong defensive plays. Simmons went to his right, falling to his knees, to snag a grounder by David Freese before throwing to second to start a double play in the second. Freddie Freeman leaned over the railing in front of the Atlanta dugout to catch a foul popup by Matt Holliday to end the eighth.