LOS ANGELES (AP) -- A must-win game turned into a job the Los Angeles Dodgers couldn't get done.
They were eliminated from playoff contention, their wild-card hopes dashed Tuesday night with a 4-3 loss to Barry Zito and the San Francisco Giants.
''Everything kind of comes to a screeching halt,'' Dodgers manager Don Mattingly said. ''To not have that opportunity to move forward is painful.''
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.
''It doesn't feel that good right now,'' Ellis said in a silent clubhouse.
The Dodgers fell short despite adding first baseman Adrian Gonzalez, pitcher Josh Beckett, infielder Hanley Ramirez and outfielder Shane Victorino in July trades.
''There's a lot of intangibles that go into a team firing on all cylinders,'' losing pitcher Chris Capuano said.
The defending World Series champion Cardinals claimed the final berth in this year's major league playoffs. St. Louis will be at Atlanta on Friday in a one-game matchup to see which team advances to the division round.
Zito won his seventh straight decision, Buster Posey and Joaquin Arias homered and the NL West champion Giants finished off their longtime rivals.
The Dodgers knew early in their game that Cincinnati had beaten St. Louis 3-1, opening the door for them to remain in the chase. But they couldn't capitalize, and will miss the playoffs for the third straight season and first under the club's new ownership, including Magic Johnson and Mark Walter, who watched from their box.
''We're not so much into knocking people out,'' Giants manager Bruce Bochy said. ''There's a lot of history between these two clubs. Both clubs have knocked each other out.''
Zito (15-8) continued his best stretch since joining the Giants in 2007. They've won his last 11 outings as the left-hander has gone 7-0 for the first time since he won eight in a row with Oakland from June 28-Aug. 4, 2005.
''Personally, I don't like to read into numbers too much,'' Zito said. ''Sometimes you go out there and feel kind of crappy and you win, and other times you feel great and you lose. (The streak) is just evidence that the team has been scoring a lot of runs and playing good 'D' when I'm on the mound.''
The former AL Cy Young winner allowed two runs and six hits in six-plus innings, struck out six and walked one to put himself in contention for a start in the NL division series.
Sergio Romo got three outs in the ninth to earn his 14th save in 15 chances after Jeremy Affeldt gave up a leadoff single to Andre Ethier that had Dodgers fans on their feet to end the game. Pinch runner Dee Gordon stole second with two outs on a close play, but Ellis hit a liner that center fielder Angel Pagan charged in to catch.
''To see Pagan catch that ball, it's kind of like the season is pretty much over,'' Matt Kemp said.
Capuano (12-12) gave up two runs and five hits in three-plus innings, his shortest outing of the season. He allowed both home runs and didn't record any strikeouts or walks. The left-hander has lost five straight decisions against the Giants and fell to 1-7 in 13 career games against them.
''Kind of a bitter pill for us to swallow,'' Capuano said. ''We really battled to the last out and had a chance. The last week has been fun. It's disappointing we couldn't finish it.''
He bruised his left shoulder in San Diego when he hit himself with a weighted doughnut off his bat while loosening up, but Capuano said it didn't bother him on the mound.
The Dodgers rallied to trail 4-3 in the seventh on A.J. Ellis' two-run homer off Guillermo Mota, who came on after Zito hit Ethier in the back to start the inning.
Ellis pumped his right arm as he rounded first base and the crowd of 42,473 erupted. After pinch-hitter Nick Punto struck out looking, Mark Ellis doubled to deep center, but was thrown out trying to stretch it into a triple.
''Yeah, I think he got excited,'' Mattingly said.
That proved costly as Shane Victorino tripled, and was stranded when Kemp struck out swinging against George Kontos to end the inning, slamming his bat to the ground. Kemp was hitless in four at-bats, with three strikeouts.
''It's kind of going to stick with me for a while,'' Kemp said. ''It hurts. I just didn't do my job. It's my fault.''
Posey led off the second with his 24th homer. The Dodgers answered right back, tying the game at 1 on Luis Cruz's RBI groundout to third base after Hanley Ramirez tripled in the bottom of the inning.
Arias homered leading off the third, giving the Giants a 2-1 lead. In the fourth, Dodgers fans cheered when the video board displayed the final score of the St. Louis game.
The Giants added two runs in the fifth on Marco Scutaro's RBI double in the right field corner off Jamey Wright, extending his hitting streak to a career-best 19 games, longest in the majors this season. Pagan, who walked leading off, beat the throw home to make it 4-1.
NOTES: The last time the Giants won 10 or more consecutive starts by one of their pitchers was when they won 11 in a row when Bill Swift started from April 6-June 27, 1992. ... The last time San Francisco lost one of Zito's starts was on Aug. 2 against the New York Mets. ... Posey started at first base after mild back spasms forced him out of Monday's game in the eighth inning. ... Dodgers 1B Adrian Gonzalez singled in the sixth, extending his hitting streak to 14 games, tops on the club. ... The Giants, who dropped the opener on Monday, haven't lost two straight road games since July 7-8 at Pittsburgh. ... RHP Clayton Kershaw will start Wednesday's season finale for LA. ... Dodgers great Maury Wills, an instructor for the team during spring training and the regular season, turned 80.