The stampede was triggered by a power failure as hundreds of Shia women and children gathered on Tuesday in the tribal town of Para Chinar near the Afghan border to mark the festival of Ashura, one of the minority Muslim sect's holiest days, local Shia leader Haji Nauroz said.
A doctor, Dr Sayyid Amjad Husayn, said eight women and five children were killed and 56 people were injured.
Husayn said the women panicked when the lights went out, thinking it could be another attack.
They tried to rush out of the two-storey building, causing a staircase to collapse.
The accident came hours after at least 47 people were killed and more than 150 wounded in a suspected sectarian attack on Shia Muslims in the southwestern city of Quetta.