The victory books Costa Rica's place at the World Cup later this year, along with $16.5 million dollars in prize money.
The Central Americans scored first, taking a 1-0 lead in just the third minute through a scrappy break away goal from Joel Campbell.
The All Whites responded well and thought they'd scored an equaliser through striker Chris Wood late in the first half, only for the goal to be ruled out by the video assistant referee, with a New Zealand player deemed to have committed a foul in the build-up.
All Whites replacement player Kosta Barbarouses was given a red card in the 67th minute for a lunging tackle, further hampering New Zealand's chances of levelling the score.
The All Whites had a couple more shots on goal in the second half but couldn't find the back of the net, with Costa Rica goalkeeper Keylor Navas holding his nerve and keeping a clean sheet.
New Zealand striker Chris Wood said after the match that his side had created the most opportunities in the match.
"We were the dominant side, possession stats would tell you, shooting stats would tell you." said Wood.
"Ultimately it was fine margins. Little things went their way, and some decisions went against us which I think were very harsh."
Costa Rica are the 32nd and final team to qualify for the 2022 World Cup, and will join Group E with Germany, Japan and Spain.
New Zealand have been to just two World Cups, 1982 in Spain and 2010 in South Africa.
Coach Danny Hay will lead the side forward with an eye to the future, with the youthful squad showing major promise building towards to 2026 World Cup to be held in Canada, Mexico and the United States.