The Mets will face the Giants in the Wild Card game on Wednesday night at Citi Field.
San Francisco clinched its spot with a 5-1 win over the Dodgers on Sunday, capping off a three-game sweep.
The Cardinals are leading the Pirates, but will finish a game behind the Giants if they close that game out.
This sets up a matchup between Noah Syndergaard and Madison Bumgarner in the do-or-die Wild Card game.
Bumgarner, who carried the Giants to the World Series title in 2014, will be on regular rest, as will Syndergaard.