The Louth side’s treble dream looked very much on when leading scorer Patrick Hoban fired them in front on 40 minutes.
However, Sheppard’s goals in the 81st and 87th minutes stunned Oriel Park.
Just as in the first game, which finished 0-0 in Tallaght last Friday, Dundalk were left to rue a series of misses when they were on top, with Barry Murphy excelling for Pat Fenlon’s side in goal.
Hoban deservedly put Dundalk in front when he headed home superbly from Darren Meenan’s delivery.
Rovers keeper Murphy was superb and he twice denied Lilies hit man Hoban after the restart before doing likewise to Andy Boyle.
Having weathered the storm, Rovers began to pile on the pressure and it finally told as they grabbed an equaliser nine minutes from time, when Sheppard raced on to Sean O’Connor’s pass to slot past Peter Cherrie.
The real drama was yet to come, however, as three minutes from time Sheppard broke clear on the right before cutting in on his left foot to rifle his shot past Cherrie and send his side through to the last four.
Cherrie; Gannon, Rossiter (Higgins 88), Boyle, Massey; Meenan (McMillan 88), Shields, Towell, Horgan; Byrne (Mountney 68), Hoban.
Murphy; Madden, Kenna, McGuinness, Byrne; Brennan (Waters 53), Robinson (McPhail 62), Cregg, Finn, O’Connor; Kelly (Sheppard 77).
D McKeon (Dublin).