It took a penalty shoot-out to see Queen of the South go through to meet Cowdenbeath in the fourth round of the Scottish Cup after the sides drew 3-3 at the end of extra-time.
The Dumfries side netted four penalties to Dundee's two.
Queens made the breakthrough after 40 minutes when Stephen Dobbie took up a pass from Sean O'Connor to neatly sidestep his marker and slipped the ball past keeper Ludovic Roy from 15 yards.
Dundee equalised three minutes after the break when a neat move by Gavin Swankie and Gary Smith set up former Queens favourite Derek Lyle to hammer the ball home from six yards.
Queens regained their lead after 69 minutes when O'Connor again slipped the ball through and Dobbie squeezed it home from close range.
But Dundee again pulled level eight minutes from time through Brian Deasley.
Queens though regained their lead through O'Connor with four minutes to go and yet again Dundee came back with Lyle levelling the score within a minute.