Updated

Carlos Beltran went 2-for-4, and his two- run homer in the fifth inning proved to be the difference as the St. Louis Cardinals earned a 4-3 victory that officially eliminated the Washington Nationals from playoff contention.

Yadier Molina and Shane Robinson each knocked in a run in the win, and Adam Wainwright (18-9) scattered three runs on seven hits over seven-plus innings. Trevor Rosenthal closed the door by recording the last two outs of the ninth.

The Nationals had won 16 of their first 21 September games to get back into the playoff race, but their rally fell short when their loss, coupled by wins from the Pirates and Reds on Monday, officially put the defending NL East champions out of the wild card race.

"We gave it a good fight, we just came up short," said Nationals manager Davey Johnson. "It's going to be a tough haul, but I'm proud of the guys. Now we're spoilers."

Rookie Tanner Roark (7-1) suffered his first loss, charged with all four runs on nine hits over five frames.

The Nationals went hitless over the two frames following Beltran's fifth- inning blast that opened a 4-2 lead for the Cards, but pulled a run closer in the eighth.

Anthony Rendon and pinch-hitter Steve Lombardozzi each singled to begin the inning and chase Wainwright from the contest. Randy Choate came into face Denard Span, who moved the runners over with a sac bunt. After Carlos Martinez replaced Choate on the mound, Ryan Zimmerman got the Nats within 4-3 with a groundout.

Washington, though, couldn't muster a hit in the ninth off either Kevin Siegrist or Rosenthal, who notched his first career save after getting Adam LaRoche to pop up for the last out.

The Cardinals, with five games remaining, hold a two-game lead over Pittsburgh and Cincinnati in the NL Central.

"We're very happy right now to have a spot in the playoffs," said Beltran. "But we're not thinking about that, we want to win our division and that's going to be our main goal."

Jayson Werth's two-run homer in the first opened a 2-0 lead for Washington, but Molina cut the Cards' deficit in half with an RBI single in the bottom portion of the frame.

Robinson then tied the game at 2-2 in the fourth, delivering the third straight single of the inning that scored David Freese from second.

Game Notes

The Cardinals had 11 hits ... Roark made his fourth start and struck out five ... Washington was 0-for-4 with runners in scoring position.