The Canucks had taken a 10-0 lead thanks to a try from lock Jebb Sinclair and a conversion and penalty from James Pritchard, but Tonga hit back with two tries from centre Siale Piutau and 10 points from the boot of Kurt Morath to lead 20-13.
Canada, however, kept their composure and scores from number eight Aaron Carpenter and Esher wing MacKenzie sealed the win, ensuring they remain unbeaten against Tonga in three World Cup finals meetings and effectively eliminating the South Sea Islanders from the tournament.
Coach Kieran Crowley had challenged the Canucks to match Tonga's physicality, and they started impressively by dominating possession and territory.
And it led to the first try after quarter of an hour as Glasgow back DTH van der Merwe slipped through some weak tackling to link with centre Ryan Smith and send lock Sinclair, who will join London Irish after the tournament, over. Bedford full-back Pritchard added the extras.
Full-back Morath missed a chance to respond as he failed with two straightforward penalties and he was punished as Pritchard put Canada 10-0 up after 25 minutes with a penalty of his own.
Canada lost flanker Chauncey O'Toole to injury, but Tonga were the ones really struggling as an endless stream of handling errors blighted their attacking ambitions.
They finally held on to the ball long enough to cause Canada problems in the shadows of half-time, with over 15 phases of play freeing the space for centre Piutau to ghost over, with Morath knocking over the conversion.
Tonga were level shortly after the break as a Morath penalty made it 10-10, but Pritchard responded instantly with his second penalty to re-establish the Canadian lead.
Tonga hit back as a simple midfield switch saw Piutau unlock the Canadian defence to stroll over for his second try, Morath was again on target with the extra two points before his second penalty gave the South Sea Islanders a seven-point advantage heading into the final quarter.
The see-saw nature of the contest continued as Canada responded with their second try. Replacement Conor Trainor made the initial yards for number eight Carpenter to burrow over, although Pritchard's conversion miss left them behind by two points.
But the miss did not prove costly as clever build-up cleared the way for Esher wing Mackenzie to race over with six minutes to play.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
$29.99
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.