Substitute Shinji Okazaki headed a late winner as Japan's Olympic preparations were given a boost with a 2-1 defeat of Australia's Under-23s on Thursday.

Archie Thompson fired the Aussies into a 34th-minute lead in steamy conditions in Kobe, but Shinji Kagawa responded with an equalizer before Okazaki snatched victory for Japan coach Yasuharu Sorimachi's men two minutes from time.

"This is the kind of heat I assume we will be playing in (at the Olympics) and I figured the real battle would be in the second half," said Sorimachi. "We did well to score at a time of the game when both teams were struggling."

Japan had the upper hand in the first half but it was Australia that drew first blood, courtesy of some sloppy defending from Maya Yoshida.

The Nagoya Grampus defender made a hash of a long ball from the Australian defense and Nikita Rukavytsya capitalized to feed Thompson, who beat Kaito Yamamoto with a sharp finish.

Hajime Hosogai went close at the other end with a far-post header and it did not take Japan long to get back on level terms. Atsuto Uchida's ball into the box found Takayuki Morimoto and a clever piece of skill from the Italian-based striker set up Kagawa to sweep home the equalizer four minutes before halftime.

With legs tiring and the game looking set to finish tied, Hiroyuki Taniguchi picked out Okazaki to secure victory with a glancing header in off the post.

Japan completes its Olympic tuneup with a friendly against Argentina in Tokyo on Tuesday.