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.
Duke's man of the match - Queens have unearthed a real striker who has an eye for goal in Dobbie