Gary Naysmith’s side looked set for a dream start when a long punt from Deniz Mehmet released Connor Murray after just a minute, however the youngster blazed well wide.
The Doonhamer did much better on 16 minutes when he headed a Jordan Marshall cross on target only for Ryan Scully to save smartly. A minute later Dunfermline looked set to take the lead when Louis Longridge sent a shot flashing towards goal, but debutant Mehmet stuck out a hand to save.
The remainder of the first half was tepid fare until the final minute when Queen’s grabbed the goal that brought their survival act alive again. Dunfermline struggled to clear the ball from a corner and Ian Wilson charged forward and drilled low into the right-hand corner of Scully’s goal from 18 yards.
The lead was doubled seven minutes into the second half when Marshall sent Josh Todd clear with a throw-in and the Dundee-bound attacker found the net with a deft curling finish.
The Pars grabbed a late consolation when Jackson Longridge headed in from a corner with the last touch of the ball.