The dramatic late goal means the United States likely needs at most a draw at Trinidad and Tobago on Tuesday to qualify for its eighth straight World Cup berth.
The chances of Honduras to hit the main event of the 2018 World Cup in connection with the defeat of Panama increased slightly.
The match had been postponed by 24 hours after heavy rainfall, and a 66th minute goal from Eddie Hernandez for Honduras may have also delayed Costa Rican celebrations.
Spain had taken the lead in the 5th minute through an own goal by Brazil's Wesley.
Giancarlo Gonzalez headed the ball toward the right flank.
Costa Rica drew 0-0 with England in the final group match but were eventually knocked out at the quarter-final stage by the Netherlands on penalties.More news: Pakistan vs Sri Lanka, 2nd Test, Day 3 at Dubai
More news: USA permanently lifts trade sanctions on Sudan
More news: Unseasonably warm, humid weekend in Lancaster; remnants of Hurricane Nate arriving Monday
Costa Rica have 16 points and are second in the final round of North and Central American and Caribbean region qualification, behind Mexico, who have 21 points and clinched a World Cup berth last month.
The United States is at 12 points following its 4-0 win Friday over Panama, and would qualify with a win at Trinidad on the final night of the hexagonal.
The U.S. hosts Panama on Friday, trailing its visiting third-place opponent by one point and level on points with Honduras, but ahead on goal differential for the fourth spot. A seven- and 12-goal lead on each side means a USA draw would technically give hope to the chasing pair, but only a slim one.
Honduras is still in the hunt for a top-four finish, now fifth with nine points, just behind on goal differential to the United States in fourth.
In addition, the USA could qualify with a loss if Panama and Honduras both fail to win Tuesday.