Ryohei Yamanaka scored a brace of tries to put Japan in the driver's seat, but a late five-pointer from Baptiste Couilloud denied the hosts a historic victory over France, who emerged 20-15 winners of the second test at Tokyo's National Stadium on Saturday.

The Brave Blossoms had never before beaten the three-time World Cup runners-up, with their best-ever result a 23-23 draw in November 2017 in Paris.

Replacement scrumhalf Couilloud caught the Japanese defense napping as he ran in straight from the back of a scrum in the 71st minute, giving the Six Nations champions their first lead since midway through the opening half.

Japan later had a potential winning try overturned when the television match official found replacement forward Tevita Tatafu did not properly ground the ball after plowing across the line.

A crowd of 57,011 observed a moment of silence for former Prime Minister Shinzo Abe before kickoff at the Olympic venue, hosting its first rugby test since being redeveloped for last summer's Tokyo Games.

Jamie Joseph's men led 15-7 at halftime but were wary of repeating the second-half collapse that saw them lose last week's first test 42-23 after being deadlocked 13-13 at the break.

Although the hosts were in the contest until the final siren, their mistakes once again proved costly against this year's European Grand Slam winners.

"I'm very disappointed with the result," Joseph said. "We obviously had a lot of chances to win that test match."

The former All Black said his relatively young and untested squad nevertheless gained valuable experience against the world No. 2 side ahead of next year's World Cup in France.

"We've played with a new team (with) a lot of players out with injury ... so that's been really good," he said. "That's been the purpose...to give some of our younger guys test match experience."

Naoto Saito returned at scrumhalf, while veteran hooker Shota Horie was named on the bench after missing the first test because of the coronavirus.

Joseph kept 21-year-old flyhalf Lee Seung Sin in the starting lineup following a solid first test after being called in late for Takuya Yamasawa, who was also sidelined by COVID-19.

The Six Nations champions controlled the early exchanges and kept Japan pinned inside their own half until Matthis Lebel crossed for the opening try in the ninth minute.

The hosts hit back three minutes later through Yamanaka, who dotted down after the ball passed through several pairs of Japanese hands on a quick-fire kick return.

Lee missed the conversion but gave Japan an 8-7 lead after Fabien Galthie's men were penalized while desperately defending their try line.

Another high-tempo passage of running rugby from the Brave Blossoms yielded Yamanaka's second try on the stroke of halftime, with Michael Leitch breaking the line before offloading to the flying fullback.

Maxime Lucu cut Japan's lead to 15-10 with a penalty early in the second half.

Japan defended doggedly to stop the 2023 World Cup hosts at the try-line midway through the half before Matthieu Jalibert's penalty brought the tourists within a kick of the lead at 15-13.

"It was a really tough game that we found a way to win," said Galthie, praising his side for staying composed after trailing at the half for the first time this season.

Japan will play France again in Toulouse on Nov. 20 during the Brave Blossoms' tour of Europe, which also includes a Nov. 12 test against England at Twickenham.