If upon entering the Masjid, a Muslim finds his fellow Muslims praying in congregation, he has to join them immediately and delay offering the two supererogatory Rak`ahs which are regularly performed prior to Fajr Prayer. This is based on the Hadith in which the Prophet (peace be upon him) said,
When the prayer commences then there is no prayer (valid), but the obligatory prayer.
The two supererogatory Rak`ahs prior to Fajr may be offered after Fajr Prayer has been offered or after sunrise. (Part No. 7; Page No. 248) May Allah grant us success. May peace and blessings be upon our Prophet, Muhammad, his family and Companions!