New Zealand held firm against 21 Japan shots to force penalties in a quarterfinal between underdogs and hosts on Saturday.
But the magic ran out in spot kicks when Japanese keeper Kosei Tane stopped New Zealand's Liberato Cacace and Clayton Lewis sent his kick nowhere near the goal.
Recommended Videos
Japan will face Spain in the semifinal after Rafa Mir's hat trick off the bench sent the Spaniards past Cote d'Ivoire in extra time.
Japan took 21 shots to New Zealand's eight, seven in the final half-hour, but couldn't get past New Zealand goalkeeper Michael Woud.
Takefusa Kubo and Ritsu Doan threatened plenty for Japan, while Chris Wood was New Zealand's best hope of finding a goal in regulation.
New Zealand lost West Ham center back Winston Reid to injury while Japan's former Premier League defender, Maya Yoshida, was a force and deservedly scored the clinching penalty.
"We would've liked to have scored in the 90 minutes but New Zealand is a good team and really gave us a tough game," Japan coach Hajime Moriyasu said. "It's going to be a tough game in the semi-finals."
Brazil, Mexico advance
Defending champions Brazil never hit top gear but did enough to beat Egypt 1-0, thanks to a first-half strike from Matheus Cunha.
Up next for Brazil are 2012 gold medalists Mexico, who put on an attacking masterclass in a 6-3 rout of South Korea in Yokohama.
Midfielder Sebastian Cordova and forward Henry Martin scored two goals each, while Eduardo Aguirre and Luis Romo also got on the scoresheet for Mexico.