Namibia had been confident of notching up their first ever World Cup win at the 17th attempt but they were overpowered by Tonga, who lost 17-10 to Georgia in their opening game.
Winger Telusa Veainu and flanker Jack Ram scored tries to give Tonga an early lead, but Namibia fullback Johan Tromp cut the deficit before flyhalf Latiume Fosita crossed the line to put his side 22-7 ahead at halftime.
Man-of-the-match Ram added his second try but Namibia refused to lie down and captain Jacques Burger touched down following a fierce rolling maul.
After Veainu added his second try, Burger drove over for his second touchdown, the first time Namibia have scored three tries in a World Cup match.
Of concern to the Tongans was an injury to lock Hale T-Pole who limped off and the woeful goal-kicking of fullback Vunga Lilo which will be need to be more accurate if they are to have a chance of beating Argentina in their next game.
New Zealand top pool C with 2 wins from 2, Tonga have 6 points, Argentina 5, Georgia 4 and Namibia none.
The All Blacks play Georgia Saturday morning, while Tonga play Argentina on Monday morning.