The St Louis Cardinals allowed six runs in the ninth inning to lose 8-6 to the New York Mets on Thursday and miss their opportunity to gain ground on the Atlanta Braves in the National League wild card race.

The Cardinals appeared set to trim the Braves' lead to a single game when they held a 6-2 lead over the Mets and needed just three more outs, but they now find themselves two behind Atlanta with six games left.

It's disappointing. There are things we learned as to why we didn't finish it off. But don't make a mistake and say we're heartbroken, said Cardinals manager Tony La Russa. Our heart is beating. We won the series. Get ready for tomorrow.

Cardinals reliever Jason Motte allowed four runs, while Marc Rzepczynski was charged with the loss as the only batter he faced, Jose Reyes, singled and scored the game-winning run on Willie Harris's hit.

Late in the game, we settled into what we do best, and that is make sure we get something good to hit, Mets manager Terry Collins said. We came through in the ninth.

The loss by the Cardinals reduces the Milwaukee Brewers' 'magic number' to clinch the National League Central to two.

The San Francisco Giants also failed to gain ground in the wild card race after losing 8-2 to the Los Angeles Dodgers.

Matt Kemp led the Dodgers attack, scoring three runs and driving in two on three doubles and a home run.

In the American League, the Tampa Bay Rays clobbered the New York Yankees 15-8 and narrowed the gap on AL wild card leaders Boston to two games.

The Los Angeles Angels suffered a 4-3 loss in 12 innings to the Toronto Blue Jays to fall three games back.