Stephen Dobbie added to Dundee’s woes as the veteran striker’s dramatic brace condemned the Dark Blues to their third defeat on the bounce.
It was no less than Queen of the South deserved despite Danny Johnson’s 92nd-minute leveller seeming like it had earned an unlikely point from another poor performace from the Dens men.
Dobbie’s first-half strike looked like it was enough to take the points back to Dumfries only for Johnson to rattle in a fine equaliser.
Seconds later, though, Dobbie stole the ball off a dawdling Jordon Forster before chipping in to make it three poor defeats on the bounce for Dundee.
For much of the contest, the Dens men struggled to test the visiting goalkeeper as Queen of the South dominated the shot count and moved to within two points of the Dens side.
Manager James McPake made four changes to his starting XI as Jack Hamilton made his comeback in goal with Conor Hazard returning to parent club Celtic, Cammy Kerr to right-back with Josh Todd and Fin Robertson back in midfield.
Paul McGowan and Josh Meekings missed out entirely after McGowan’s young child took ill on Thursday and Meekings had a back spasm. Shaun Byrne was on the bench.
The Dark Blues made much of the early running, dominating possession but struggling to find a way through a packed Doonhamers defence.
Attacks from the visitors were few and far between but there was a warning of what was to come from Dobbie as he forced Hamilton into a save on 15 minutes.
Thirteen minutes later he gave the goalkeeper no chance after nipping away from Jordan McGhee and Robertson before rattling a low effort into the corner from 20 yards to make it 1-0.
Dundee were still in control of possession but Queens continued to hit on the break and El Bakhtaoui had the chance to double their lead on 39 minutes as he sped through but hit straight at Hamilton.
With Queens goalie Robby McCrorie untested, McPake threw on striker Danny Johnson to partner Kane Hemmings as Jamie Ness limped off before the break.
After the break, a mix up between Sean Mackie and McGhee gave Connor Murray a free look at goal but the winger fired just wide before El Bakhtaoui stung the fingertips of Hamilton.
Finally the Dark Blues gave McCrorie some work to do on 57 minutes and it looked like they’d found the equaliser through Hemmings’ low shot but the goalie gathered at the third attempt.
That didn’t spark life into the display, however, as Dundee continued to struggle to break the Doonhamers down.
They finally did, however, after 92 minutes as Johnson found the top corner with a super strike.
Seconds later that was undone as, straight from the kick-off, Dobbie pinched the ball off Forster to win the game for his side and see boos ring out at full-time from the home support.
Dundee: Hamilton, Kerr, McGhee, Forster, Mackie, Ness (Johnson 44), Robertson (Moore 69), Todd, McDaid, Dorrans, Hemmings.
Unused subs: Ferrie, Byrne, McPake, Strachan, Cunningham.
Queens: McCrorie, Mercer, Holt, Brownlie, Kilday, Pybus, Murray (Paton 80), Dobbie, Osman, Lyon, El Bakhtaoui.
Unused subs: Leighfield, Gourlay, Irving, McCarthy, Kidd, Oliver.