ST. LOUIS (AP) -- Carlos Beltran was unaware that he had gone a season-long 24 games without a home run.
"I don't think about things like that," he said. "It's not about homers. It's about helping the team."
Beltran ended his drought with a tiebreaking shot, Adam Wainwright earned his 18th win and the St. Louis Cardinals beat Washington 4-3, eliminating the Nationals from playoff contention.
Looking for their first NL Central title since 2009, the Cardinals maintained a two-game lead over Cincinnati and Pittsburgh with five to play.
All three teams are headed to the postseason. The Reds and Pirates both won Monday night, clinching at least a wild-card berth when Washington lost.
St. Louis secured no worse than a wild card on Sunday.
The Nationals won the NL East last season with 98 wins, but were eliminated by St. Louis in the division series. One year later, they were knocked out by the Cardinals again.
"It doesn't feel too good," manager Davey Johnson said. "We gave it a good fight. We just came up short.
"Now, we're spoilers. So it's not over for us."
Beltran's two-run homer in the fifth off rookie Tanner Roark broke a 2-all tie. It was his team-leading 24th of the season and first in 91 at-bats since Aug. 24.
"The last thing I was thinking about there was a home run," Beltran said. "I've been scuffling a little at the plate, but the way for that to go away is to keep playing and continue to swing the bat."
Wainwright (18-9) gave up three runs and seven hits over seven-plus innings. He struck out five, giving him a career-high 214 on the season.
"This was a great team win. Everybody did their part," Wainwright said.
Jayson Werth hit a two-run homer on the 15th pitch of the game. Wainwright then retired nine in a row and allowed just one run on five hits the rest of the way. He moved into second in the NL in wins behind Washington right-hander Jordan Zimmermann, who has 19.
"The first inning, sometimes great teams are going to put a couple runs together like that," Wainwright said. "The key is to keep pitching and limit the damage."
St. Louis manager Mike Matheny was impressed with the way Wainwright bounced back from the slow start.
"It's amazing that once he gets going, how different his stuff looks," Matheny said. "It doesn't matter what he looks like early, he's going to put it together."
Trevor Rosenthal got two outs for his first career save.
Roark (7-1) gave up four runs and five hits in five innings for his first loss in four starts. He went 45 2-3 innings before allowing his first home run.
"I didn't have fastball command and I was getting behind hitters," Roark said. "If you do that against a good team, they're going to hit your mistakes."
Washington closed to 4-3 in the eighth on singles by Anthony Rendon and Steve Lombardozzi and a groundout from Ryan Zimmerman. St. Louis reliever Carlos Martinez got Werth to ground out with a runner in scoring position to end the threat.
The Cardinals climbed within 2-1 on a run-scoring single by Yadier Molina in the first. They tied it on successive singles from David Freese, Daniel Descalso and Shane Robinson in the fourth.
Robinson replaced Matt Holliday in the lineup. Holliday was a game-time scratch for the second night in a row due to back spasms. He is day to day.
"He thought it was going to loosen up better than it did," Matheny said.
NOTES: Cardinals broadcaster Mike Shannon, 74, returned to the booth four weeks after undergoing surgery to replace an aortic valve in his heart. Shannon, who played on the Cardinals' 1964 and 1967 World Series championship teams, made his announcing debut in 1972. He received a standing ovation when his picture was flashed on the video screen during the second inning. ... The Cardinals have 92 wins, their most since winning 100 games in 2005. ... Cardinals 1B Allen Craig will be re-evaluated Thursday. Craig has missed the last 18 games with a left foot sprain sustained Sept. 4. ... The Nationals have a 24-8 advantage in homers over their last 17 games. ... St. Louis rookie Michael Wacha (3-1, 3.21 ERA) will face LHP Gio Gonzalez (11-7, 3.39) in the second game of the three-game set Tuesday.
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.