Parents told the BBC they had seen girls being taken away in trucks.
The attack comes four years after Boko Haram kidnapped more than 270 girls from a school in the town of Chibok.
In a statement, the Yobe state government said an unspecified number of girls had been rescued from the "terrorists who abducted them" and were now with the army.
Reuters news agency quoted parents and a government official as saying that 76 girls had been rescued and at least 13 were still missing
Two girls had been found dead, Reuters said, without specifying how they had died.
Yobe state officials had previously said there was no information to suggest any of the girls had been kidnapped.
Dapchi is about 275km (170 miles) north-west of Chibok.
The jihadists entered the town firing guns and letting off explosives, causing students and teachers to flee into the surrounding bush.
Residents say that Nigeria's security forces - backed by military jets - later repelled the attack.
Locals living near the school told the BBC that many of the girls who had fled had been found after hiding in surrounding villages - some up to 30km away.
Yobe's police minister said that 815 of the school's 926 students had later returned to the school.
The minister was speaking before news that more girls had been rescued by the military.
What has happened to the Chibok girls?
Last September, a group of more than 100 of the Chibok girls were reunited with their families at a party in Abuja.
Most of the group were released in May as part of a controversial prisoner swap deal with the Nigerian government that saw five Boko Haram commanders released.
But more than 100 schoolgirls are still being held by Boko Haram, and their whereabouts are unknown.
Boko Haram militants have been fighting a long insurgency in their quest for an Islamic state in northern Nigeria. The conflict is estimated to have killed tens of thousands of people.
The Chibok girls represent a fraction of the women captured by the militant group, which has kidnapped thousands during its eight-year insurgency in northern Nigeria.