The defending World Series champions were beaten by Cincinnati 3-1 but wrapped up the second NL wild card hours later when the Giants won 4-3 at Dodger Stadium. St. Louis will play at Atlanta on Friday in the new one-game playoff between wild-card teams.
The Dodgers' loss left them two games behind St. Louis with one game to go.
GIANTS 4, DODGERS 3
LOS ANGELES -- The Los Angeles Dodgers were eliminated from playoff contention, their wild-card hopes dashed to Barry Zito and the Giants.
The defeat left the Dodgers two games behind St. Louis with only one game left in the regular season. Los Angeles had won six in a row to stay in the race for the second NL wild-card spot, but Mark Ellis lined out to center field with a runner on second base to end it.
The defending World Series champion Cardinals will open the playoffs Friday at Atlanta in a one-game matchup.
MARLINS 4, METS 3, 11 innings
MIAMI -- New York Mets knuckleballer R.A. Dickey struck out one-shot wonder Adam Greenberg, but also gave up two homers in his final start of a Cy Young-hopeful season and the Mets lost to the Marlins.
The Marlins' Greenberg struck out on three pitches against Dickey when he batted for the first time in seven years in the sixth inning. Greenberg signed a one-day contract before the game, his first since he was beaned in his major league debut in 2005.
In his bid for his 21st victory, Dickey left after six innings trailing 3-0, but the Mets rallied with three runs in the eighth to tie the game. After Marlins rookie Jacob Turner allowed one run in 7 2-3 innings, beleaguered former All-Star Heath Bell helped blow their lead.
NATIONALS 4, PHILLIES 2
WASHINGTON -- A smile crept across Adam LaRoche's face while he rounded the bases Tuesday night after hitting his career-high 33rd homer to become the third Nationals player with 100 RBIs in a season, another celebratory moment for NL East champion Washington during a victory over the Phillies.
When the Nationals Park gates opened, early-arriving fans in the crowd of 33,546 were treated to a video montage of alcohol-spraying and general mirth-making from a night earlier, when the home team clinched its first division title since moving from Montreal in 2005.
Even the guy playing the national anthem on his bat-violin Tuesday wore a gray T-shirt marking the accomplishment.
PIRATES 5, BRAVES 1
The Pirates (79-82) tied for their most wins in a season since their North American major professional sports record streak of 20 losing seasons began in 1993. The 1999 Pirates went 79-83.
A day after being eliminated from the NL East division title race, the wild-card Braves rested several regulars and shuffled players in and out of the lineup throughout the game. Atlanta will host the NL wild-card game Friday.
ASTROS 3, CUBS 0
The season-ending series between NL Central clubs marks the first meeting of 100-loss team in the majors since 1962, when the Cubs played the New York Mets.
Houston (55-106) threw its third straight shutout and won for the fifth time in six games. The Astros have already matched last year's franchise-worst loss total with one game left.
Norris (7-13) scattered four hits and won back-to-back starts for the first time since May.
Chris Volstad (3-12) took the loss for the Cubs, who fell to 60-101.
BREWERS 4, PADRES 3
MILWAUKEE -- Rookie Martin Maldonado hit a grand slam and the Brewers used 10 newcomers in beating the Padres.
Maldonado connected against Anthony Bass (2-8) in the third inning for his first career slam and eighth home run of the year. The backup catcher was in a 1-for-16 slump since Sept. 10 when he delivered.
DIAMONDBACKS 5, ROCKIES 3
PHOENIX -- Aaron Hill hit a game-winning three-run home run with two outs in the ninth inning to lift the Diamondbacks over the Rockies.
Jordan Pacheco had hit a two-run double in the top of the eighth to give the Rockies a 3-2 lead.
Rafael Betancourt (1-4) blew his second save in as many nights.
Brad Ziegler (6-1) pitched the ninth for the victory.
Copyright 2012 by The Associated Press
This story is from ESPN.com's automated news wire. Wire index
MORE MLB HEADLINES
- Nats' Werth to serve 5 days for driving 105
- Minaya leaves Padres to be MLBPA adviser
- McCain: Time to talk legalizing sports betting
- Pearce, O's agree to $3.7M, 1-year contract