Jason Heyward’s two-run blast in the 12th inning Friday, the sixth home run of the game, gave the Atlanta Braves a 9-7 triumph over St. Louis.

St. Louis had four of the homers, two of them from Carlos Beltran, but still had a four-game winning streak come to an end.

The Cardinals rallied from a 5-1 deficit through three innings to take a 6-5 lead heading into the seventh.

Dan Uggla homered for the Braves in the seventh to tie it and both teams scored a run in the eighth — the Cardinals’ tally coming on Beltran’s second homer of the evening, his 12th of the season.

St. Louis loaded the bases in both the 10th and 11th innings without scoring and Atlanta finally broke through in the 12th when Chipper Jones drew a leadoff walk from Kyle McClellan (0-1) and scored on Heyward’s homer to center.

Livan Hernandez (1-0), who recorded the first save of his career last Saturday, got the win by working two innings. Craig Kimbrel allowed a leadoff single in the 12th before posting his 11th save.