Five people have been killed, and around two dozen are being held hostage after gunmen attacked a copper-gold mine in southwestern Pakistan, an official has said.