Despite failing to come out of Estadio Nacional with a point, the USA's last-gasp victory over Panama secured El Tri a two-legged tie against New Zealand
With their rivals for fourth place, Panama, leading the already-qualified USA 2-1, El Tri's chances of making it to Brazil appeared dead in the water. However, a late American rally gifted Mexico a World Cup play-off against Oceania outfit New Zealand.
Mexico battled from behind for much of the night, but not before having the chance to seize control of the game early on.
Javier Hernandez continued his struggles in front of goal, failing to convert Mexico's first great chance of the night. After a sharp passing sequence sent Oribe Peralta through behind the defense, the Santos Laguna forward squared his ball to Hernandez as Costa Rica goalkeeper Keylor Navas raced off his line. Chicharito attempted to one-time his shot into the vacated net, but he scuffed it and mishit it off Peralta, who was standing in an offside position by the far post, therefore negating the strike.
Mexico was made to rue that miss moments later, as Bryan Ruiz opened the scoring. The Fulham man scored in the 25th minute, getting in behind Mexico center backs Rafa Marquez and Hugo Ayala, latching onto a clipped, bouncing ball over the top and heading the ball to create space for himself as he turned and fired a left-footed volley past a helpless Ochoa.
As of that moment, considering Panama's 1-0 lead over the USA, Mexico was out of the World Cup, but Oribe Peralta helped El Tri jump back into fourth place just four minutes later.
Again it was Hernandez that had a potential chance elude him, as Navas came off his line to swat a ball off his foot in the area. Peralta, though, was there to fire home a follow-up shot off the underside of the crossbar to level the score.
Hernandez missed another opportunity at the end of the first half, with Peralta sparking the build-up with a ball down the right channel for Javier Aquino. The Villarreal winger crossed to the near post, where 'Chicharito' was making his run, but he put his first-time chance into the side netting.
Hernandez departed in the 60th minute for Friday's goal-scoring hero Raul Jimenez, but not before picking up a yellow card that will have him suspended for the first leg against New Zealand.
Alvaro Saborio, who replaced Ruiz in the 49th minute, put Costa Rica back ahead off a free header in front of Ochoa minutes later, which put Mexico back out of the qualification places for just a moment until the USA tied things up with Panama just seconds later.
Navas and Ochoa exchanged highlight-reel saves to preserve the 2-1 scoreline, and Costa Rica midfielder Cristian Bolanos' miss off the far post in the 75th minute did the same.
With Mexico unable to beat Navas and its fate resting solely in the USA's hands, the Americans came through at the death to keep Victor Manuel Vucetich's side alive for at least two more games.