However they managed only one goal from a PC, by Andy Hayward late on, which is a concern. The ball was repeatedly mistrapped, squandering opportunities at the set piece.
New Zealand were 1-0 up at halftime, through a nifty Stephen Jenness goal, wriggling along the baseline and beating Japan's goalkeeper at his near post.
It was not until early in the final quarter that the margin increased, with a penalty stroke from Shea McAleese. Hayward's goal made the result certain before Genki Mitani pulled one back for Japan, only for Steve Edwards to finish the scoring in the final minute.
''The Spain game is hugely important. It still gives us a chance to go to Rio and we've got to put ourselves in the best position," Hayward said.
New Zealand could go directly to Rio if they beat world No 1 Australia in the Oceania Cup in Taranaki in October but they don't want to rely on that route.
''Spain have improved as the tournament has gone on, they're a pretty dangerous, skillful team and our defenders have to be on their game," he added.
Spain kept their chances alive by beating Korea 4-2 on penalties after the scores were level 2-2 at full time.
Meanwhile, the women's Black Sticks were beaten 2-0 by the Netherlands in the second of two warmup internationals at the Noordwijkse Hockey Club south of Amsterdam today.
The fourth-ranked New Zealanders and world No 1 Dutch are preparing for their World League semifinal in Antwerp this week. The Dutch won the first match 3-1.