Joey Votto homered off Kyle Farnsworth in the 10th inning for Cincinnati, who got three unearned runs in the ninth to tie the game.
Cincinnati pushed across the three runs off closer Mark Melancon to tie it and Votto won it an inning later with his 24th homer.
The St Louis Cardinals, meanwhile, solidified their hold on the division with a 7-6 win over the Milwaukee Brewers in 10 innings.
Carlos Beltran’s 10th-inning sacrifice fly scored Kolten Wong to give the Cardinals the win and open up a two-game lead over Cincinnati and Pittsburgh.
Former Brewers closer John Axford (7-7) picked up the win, while Carlos Martinez got his first save of the year for the Cardinals.
The Washington Nationals also kept their slim wild-card chances alive with a 8-0 win over the Miami Marlins.
Jordan Zimmermann pitched a two-hitter and picked up his NL-leading 19th win for the Nationals, who trail Cincinnati and Pittsburgh by five games with nine to play for the NL’s second wild-card berth.
In other games, the New York Mets got a homer from David Wright in his return to the lineup as they handled the Philadelphia Phillies 6-4.
Wright’s homer moved him past Mike Piazza into second on the club’s career list with 221 homers. Darryl Strawberry is No. 1 with 252.
Colorado’s Jhoulys Chacin tossed six shaky innings and helped himself with his first career home run as the Rockies beat the Arizona Diamondbacks 9-4.
The San Diego Padres beat the NL West division champion Los Angeles Dodgers 2-0, with all of the Dodgers’ regulars resting for the playoffs.
And the Los Angeles Angels’ Chris Iannetta drove in Kole Calhoun with a two-out hit in the 11th inning to rally past the Seattle Mariners 3-2.