Reference: Taqyeed ash-Shawaarid min al-Qawaa.id wal-Fawaa.id – Page 294
Whoever forgets [to perform] the maghrib prayer, and then remembers it when he is [just starting the prayer by] saying “Allaahu Akbar” for the maghrib prayer the following day, then he is [immediately] required to break his prayer, and then make up the missed [maghrib prayer from the day before] and then pray the current maghrib [prayer].