The attack happened on Thursday evening in Rann, near the border with Cameroon, where nearly 80,000 people depend on emergency food aid and medical care.
At least one other aid worker was critically injured and another three were missing. Eight Nigerian soldiers were also killed.
A UN spokeswoman in Abuja, Samantha Newport, told AFP: “Operations in Rann were temporarily suspended for one week from yesterday morning (Friday).
“Yesterday, we evacuated 52 aid workers and the three deceased, in addition to 300 kilos (661 lbs) of medical supplies that were going to go bad.”
The aid workers are not believed to have been specifically targeted but were caught up in an attack on the military.
Those killed were Nigerians working for the International Organization for Migration and the UN children’s fund Unicef. The injured and missing are also locals.
Newport said an assessment would be conducted in the coming days about damage caused to facilities used in the relief effort, as well as security.
But she said there would be “extremely minimal impact” on people in Rann, where 55,000 people displaced by the Boko Haram conflict are housed in a camp.
Operations elsewhere in the region were also continuing as normal, she added.
Doctors Without Borders (MSF), which has worked in Rann since January 2017, announced on Friday it had suspended medical activities and withdrawn 22 staff.
It said it would return “as soon as the conditions allow”.
In January 2017, a botched Nigerian air strike intended to hit jihadist fighters killed at least 112 people in Rann as aid workers distributed food.
Six Nigerian Red Cross workers were among the dead.
At least 20,000 people have been killed and more than two million others made homeless in Boko Haram’s Islamist insurgency since 2009.
The conflict has also caused a humanitarian crisis in northeast Nigeria and the wider Lake Chad region, particularly chronic food shortages.
The UN said it needs $1.05 billion (805 million euros) this year to provide help to 6.1 million people in Borno and the neighbouring states of Yobe and Adamawa.