W4 6313 then EC 7652 at Madrid
Milan → Madrid → Lisbon
Timetable, Madrid time
22:25W4 6313 from Milan at the gate
22:10EC 7652 to Lisbon leaves the gate
23 h 45 apart on the timetable, overnight
EC 7652 leaves 23 h 45 after W4 6313 arrives on the timetable: more than half a day, so not a connection we count.