EC 7639 then FR 3876 at Madrid
Lisbon → Madrid → Tangier
Timetable, Madrid time
09:35EC 7639 from Lisbon at the gate
06:10FR 3876 to Tangier leaves the gate
20 h 35 apart on the timetable, overnight
FR 3876 leaves 20 h 35 after EC 7639 arrives on the timetable: more than half a day, so not a connection we count.