Centres Owen Williams and Ashley Beck crossed for tries as Wales cruised into a 17-0 lead after just 25 minutes.
They appeared on course for a second comprehensive autumn triumph but failed to build upon the foundations set and blew several try-scoring opportunities to leave centurion Gatland with plenty of frustrations.
Man-of-the-match Luke Charteris told the BBC: “It was pretty ugly out there. We knew going into the match how good a side Tonga were and we were not clinical enough.
“A team dogged like this will keep putting us under pressure but we won the game.
“I should have had two tries but didn’t manage to get them.”
The Six Nations champions looked to have taken the lead after just five minute when Ryan Jones charged down Taniela Moa but the Tonga scrum-half, with Viliami Ma’afu did enough to prevent Lloyd Williams from grounding the ball.
The hosts continued to dominate both territory and possession and Leigh Halfpenny booted them into the lead on 12 minutes.
Just four minutes later they grabbed the opening try from a scintillating counter-attack launched from the edge of the twenty-two.
James Hook fixed the defence and put Halfpenny through the gap, the IRB World Player of the Year nominee cut inside and offloaded to Williams.
The Cardiff Blues centre appeared to have taken the wrong option, ignoring Hallam Amos on the outside but he showed a blistering turn of pace and brushed off two Tongan defenders to race home.
Halfpenny converted expertly from the touchline to bring the scores to 10-0 after little more than quarter of an hour.
Wales stretched their lead even further ten minutes later thanks to Beck. Hemani Paea came flying out of the Tongan line but the centre released George North with an inside pass.
The giant wing beat four defenders but was hauled down after losing a boot. Possession was recycled and Hook sent Beck over with a perfectly weighted miss-pass.
Halfpenny made no mistake with the conversion but Beck was quickly at fault as Tonga fought back.
The centre missed a simple tackle on Sione Kalamafoni and the Gloucester flanker evaded two defenders before releasing Will Helu with an inside flick.
Latiume Fosita converted to bring the scores to 17-7 at the break but Wales quickly asserted their dominance in the second-half.
They should have kick-started the scoreboard within minutes of the restart following a deft Hook chip and strip but Tonga hung on by the skin of their teeth.
Minutes later Amos was denied a try on his debut and Tonga were dealt a blow after Sione Kalamafoni was helped off just moments after back-row partner Ma’afu also departed.
Wales continued to pile on the pressure as they set-up camp in Tonga territory but the spirited south sea islanders refused to throw in the towel as the hosts made costly errors in try-scoring positions.
Charteris was next to lose the ball agonisingly short of the whitewash and the Perpignan second-row was at fault as Wales saw a third try ruled out by the TMO.
Williams sniped down the blindside and offloaded to Ryan Jones. He was held short but George North drove over the line only for Carlo Damasco to rule that Charteris blocked the Tongan defence.
Tonga continued to frustrate Wales as the hosts failed to register a single-point following Halfpenny’s 25th minute conversion.