Jamison Gibson-Park and Joey Carbery were ambitious and rewarded. Carbery, playing his first test since the World Cup after a nagging ankle injury, attacked the line, troubled the Japanese with his kicks, and nailed six of his seven goalkicks.
The Irish spread their five tries among backs Chris Farrell, Stuart McCloskey and Jacob Stockdale, and forwards Finlay Bealham and man-of-the-match flanker Josh van der Flier.
Japan, a week after restricting the British and Irish Lions to 28-10, had tries from captain Michael Leitch, center Timothy Lafaele, wing Siosaia Fifita, and scrumhalf Naoto Saito. Yu Tamura converted them all and added a penalty.
Farrell's was the opening try after impressive handling and offloads. Japan replied with Leitch's try from a lineout maul.
McCloskey scored with his second touch after a Carbery kick ahead, and Lafaele, who had a try disallowed after 16 phases because of a forward pass, got it a second time following a crossfield kick to Fifita.
Carbery was held up over the line but Bealham barged over from a tap and go on halftime to put Ireland ahead.
After the interval, Fifita was fastest to a Tamura break and chip to regain the lead for Japan, then Ireland went in front for good following tries to Van der Flier from lineout ball and Stockdale.
A counterattack try finished by Saito between the posts reduced the margin to two but Japan replaced Tamura and Saito and Ireland finished stronger.