The Taliban said the claims were intended to discredit it. The movement sees Daesh, which is fighting to create a global caliphate, as a hostile force.
However, Afghan government officials quoted villagers as saying as many as 600 fighters, who appeared to include both Taliban and Daesh militants, had overrun Mirza Olang village in the northern province of Sar-e Pul on Saturday.
They said that many of the fighters appeared to be foreigners, speaking Turkmen, Uzbek and Punjabi, a language spoken in the Punjab region of Pakistan.
The reports appeared to offer support to claims that the Taliban have been using foreign fighters, but in a region with a patchwork of different ethnicities and national borders close by, establishing a true picture is difficult.
"The Afghan government and its foreign masters are making false claims that we are working with Daesh (Islamic State) just to discredit us in the local community," one Taliban commander said.
However, the Mirza Olang incident adds to the picture of growing insecurity across Afghanistan where many remote areas are completely out of government control.
Zabihullah Amani, a spokesman for the provincial governor, said that contact with the village was difficult, in part because fighters had been going house to house confiscating mobile telephones.
The Taliban said a force led by a commander named Ghazanfar had staged the attack and had killed 28 local police members but they denied using foreigners or cooperating with Daesh.
A senior Taliban member said the fighters were Uzbeks, but he did not say whether they were part of Afghanistan's substantial Uzbek minority or from Uzbekistan itself.
"We don't have Arabs, Turkmen or Pakistanis in that area. Only the Uzbek mujahideen took part in the fighting," he said.
Afghan officials say that villagers reported exceptionally brutal treatment in the Mirza Olang attack, including beheadings and victims being thrown off a cliff. The Taliban denied such killings.
"Our fighters didn't behead them but it's possible they were killed in fighting," said one senior Taliban member.