Carlos Beltran tied the game with a pinch- hit RBI single in the eighth inning and David Freese drove home the go-ahead run in the ninth, as the St. Louis Cardinals outslugged the Washington Nationals, 10-9, in the third installment of a four-game set.
Matt Carpenter hit a three-run double, while Freese and Matt Holliday both clubbed two-run homers for the Cardinals, who continue to hold the National League's final wild-card spot.
St. Louis snapped a four-game losing streak, during which it registered only one run, and a seven-game skid in the nation's capital.
"Our guys have the ability to put runs on, no matter who we're facing," said Cardinals manager Mike Matheny.
Cardinals starter Kyle Lohse and his Washington counterpart, Jordan Zimmermann, were both tagged for eight runs. Only five of the runs Lohse allowed were earned.
Adam LaRoche knocked in three runs for the National League East-leading Nationals.
St. Louis took an 8-6 lead with a four-run fourth. Freese led off the inning with a double and Zimmermann hit two batters to load the bases with two outs. Carpenter then cleared them with a double off the right-field wall.
Holliday, who homered in the third to trim the Cardinals' deficit to 6-4, followed with a walk, forcing a pitching change. Allen Craig greeted Craig Stammen with a single to score Holliday.
But the Nationals moved back ahead in the sixth. Danny Espinosa led off with a home run to right-center field. Jayson Werth doubled off Lohse with two outs and Marc Rzepczynski walked Bryce Harper before Fernando Salas gave up a game- tying RBI single to Ryan Zimmerman. Harper also scored on the play, taking out catcher Yadier Molina at home for the go-ahead run.
Pinch-hitter Shane Robinson worked a nine-pitch walk to lead off the eighth and advanced to second on a sacrifice bunt before Beltran's hit to center knocked him in.
After Mitchell Boggs (3-1) retired the Nationals in order in the home eighth, Drew Storen (1-1) gave up a leadoff single in the ninth to Craig, who stole second base and scored on Freese's single to left.
Jason Motte closed the door in the bottom of ninth for his 32nd save of the season.
"We got a chance to win the series tomorrow. We have been playing good ball," said Werth.
The Nationals jumped out to an early lead Saturday afternoon, scoring four two-out runs in the first inning. LaRoche plated Harper, who doubled, with a line drive to right field and came home along Michael Morse when the left fielder Holliday misplayed Ian Desmond's fly ball.
After Espinosa reached on an E6, Kurt Suzuki put Washington up 4-0 with a base hit to center. LaRoche added a two-run homer in the second after Freese went deep in the top of the inning.
The Nationals recalled pitcher John Lannan, catcher Sandy Leon and outfielder Eury Perez from Triple-A Syracuse on the first day rosters could be expanded. The club also reinstated infielder Mark DeRosa from the 15-day disabled list. DeRosa missed 25 games with an abdominal injury ... The Cardinals activated first baseman Lance Berkman from the 15-day DL and recalled pitcher Sam Freeman from Triple-A Memphis. Berkman had been sidelined since August 3 with a right knee injury.