Stephen Kenny watched two former Derry City players inflict the damage on his Dundalk side at Oriel Park as Coleraine came from behind to seal a thrilling victory.
David McDaid's double, along with a Ruairi Harkins strike, mean that the Bannsiders will hold the upper hand going into the second leg in a fortnight.
The home side took the lead in the 18th minute when Stephen O'Donnell's beautiful backheel found fellow Galwegian Daryl Horgan,who curled it home.
The Lilywhites were stunned in the 34th minute when McDaid's 25-yard drive went in off the bar.
McDaid made it 2-1 after 49 minutes when he prodded home at the back post from Harkin's delicious cross. And Harkin sent the travelling fans into raptures when he squeezed a drive past Peter Cherrie nine minutes later.
Dundalk were given hope when David McMillan rose to power home a Dane Massey corner four minutes later.
Dundalk – Cherrie; Rossiter, Kelly (Mountney 86), Boyle, Massey; O'Donnell, Towell, Higgins (Meenan 78); Horgan (Byrne 67), Hoban, McMillan.
Coleraine – Ferry; Watt, Douglas, Canning, McNeil; Harkin, Lowry, Hegarty, Owens (Bradley 88); McDaid, Browne (Tommons 52).
Ref – P McLaughlin