FR 5316 then EC 7652 at Madrid
Rome → Madrid → Lisbon
Timetable, Madrid time
23:40FR 5316 from Rome at the gate
22:10EC 7652 to Lisbon leaves the gate
22 h 30 apart on the timetable, overnight
EC 7652 leaves 22 h 30 after FR 5316 arrives on the timetable: more than half a day, so not a connection we count.