Two unidentified men tossed a grenade at the mosque, killing the two men aged 46 and 47.
Police said the victims, most of whom were Muslim preachers from the island province of Basilan and nearby provinces, were sleeping during the attack.
No one has so far claimed responsibility for the attack.
The mosque attack took place following Sunday's twin blasts in a cathedral on Jolo island in Sulu province in southern Philippines that killed more than 20.
The Philippines has been on high alert while authorities are investigating the Jolo attack.
More about: #Philippine