Halani Aulika, Fetu'u Vainikolo and Sonatane Takulua all crossed over for the Tongans, with Hendrik Tui scoring Japan's only try.
Japan led 6-3 following two penalties from Ayumu Goromaru, before Aulika's 30th minute try was converted by Kurt Morath to give Tonga a 10-6 lead. However, Tui responded to put Eddie Jones's side momentarily back in front.
Two further kicks from the boot of Morath ensured the Tongans held a 16-11 lead at the break. It soon became a contest of kicking, with Ayumu Goromaru landing two penalties shortly after the interval to once again give Japan a slim lead.
Vainikolo's try restored the advantage for Tonga and, after Hayden Hopgood's yellow card reduced Japan to 14 men, Takulua took full advantage to secure victory for his side.