Reference: Salīm, ʿAmr ʿAbul-Muniʿim (2006), al-Masāʾil al-ʿIlmiyyah wa al-Fatāwā al-Sharʿiyyah Fatāwā al-Shaykh al-ʿAllāmah Muḥammad Nāṣir al-Dīn al-Albānī fī al-Madīnah wa al-Imārāt, First Edition. Ṭanṭā: Dār al-Ḍiyāʾ.
Question: “A man enters the masjid and the ʿIshāʾ prayer has started and he has not prayed the Maghrib prayer, what should he do?”
Response: “This man should follow behind the Imām who is praying ʿIshāʾ and have the intention of the Maghrib prayer. When the Imām gets up for the fourth rakʿah; he should intend to disconnect from the Imām and sit and do the tashahhud and complete his prayer on his own.”