EW 2604 then EC 7645 at Lisbon
Stuttgart → Lisbon → Madrid
Timetable, Lisbon time
17:55EW 2604 from Stuttgart at the gate
15:00EC 7645 to Madrid leaves the gate
21 h 05 apart on the timetable, overnight
EC 7645 leaves 21 h 05 after EW 2604 arrives on the timetable: more than half a day, so not a connection we count.