One of the peacekeepers was "gravely wounded" in the attack on Saturday at Sake, said UN mission head Bintou Keita.
The strategic town lies 20 kilometers (12 miles) west of Goma, capital of North Kivu province, and fighting resumed in the area on Saturday, witnesses said, after several days of quiet.
By midday Sunday, a precarious calm had settled over the region, the witnesses added.
A DRC security source told AFP the U.N. soldiers were wounded when two M23 shells landed on their camp in Sake's Mubambiro district.
M23 was shelling the town after "patriotic" militia known as "Wazalendo" that support the army had attacked the rebels, the source said.
The Tutsi-led M23 (March 23 Movement) launched a new offensive two weeks ago against several towns, 70 kilometers from Goma, extending its control northwards in the Rutshuru and Masisi territory.
Keita, the U.N. secretary general's special representative in the DRC, said in a statement the peacekeepers had been deployed in North Kivu for several weeks under Operation Springbok where the army and peacekeepers "are carrying out joint operations,"
Lieutenant-colonel Guillaume Ndjike, the province's army spokesman, accused Rwandan forces of targeting the U.N. position at Sake during the clashes.
The 15,000 U.N. troops deployed in the DRC started to leave at the end of February at the request of the Kinshasa government which considers them ineffective. The withdrawal is due to be completed by the end of the the year.
After eight years of dormancy, the M23 rebellion took up arms again in late 2021, seizing large swathes of North Kivu—cutting off all land access to Goma except the Rwandan border road in early February.
According to Kinshasa, the United Nations and Western countries, neighboring Rwanda is backing the M23, which Kigali denies.
Tens of thousands of people have been displaced by the latest battles. The U.N. estimated at the end of 2023 that nearly seven million people were displaced in the DRC, including 2.5 million in North Kivu alone.