The soldiers were all members of the Tanzania People’s Defence Forces participating in a peacekeeping operation in the conflict-torn eastern region of the country.
“I am very shocked and saddened to hear of the deaths of our young, brave soldiers and heroes who lost their lives carrying out their peace mission in our neighbour the DRC,” Magufuli said in a statement in Swahili.
He added that two other soldiers were still unaccounted for, though it was unclear if one of those was already included in the death toll.
The UN base in North Kivu province came under attack by suspected Ugandan rebels on Thursday.
Five Congolese soldiers and a further 53 personnel were also injured, the UN Security Council said.
The attack is the worst loss of life to a UN peacekeeping force since 1993 when 24 Pakistani soldiers were killed in Somalia during clashes with a local warlord.
DR Congo’s huge eastern region has long been wracked by violence, but fighting between government soldiers and militia groups, as well as inter-ethnic clashes, has increased significantly this year.
UN chief Antonio Guterres led an outpouring of outrage over the deadly ambush, calling it a “heinous” act.
Download our app and read this and other great stories on the move. Available for Android and iOS.