It took an extra-time goal from debutant David Robertson to edge a seven-goal thriller Livingston's way.
Queens raced to a two-goal lead after Andrew Dowie's header was followed by Iain Russell's close-range strike.
Craig Sives nodded home to give Livi hope and they levelled through Daniel Mullen's right-footed effort.
The visitors struck first in extra time as Myles Hippolyte netted but they were pegged back by Michael Paton's shot before Robertson scored from six yards.
Queen of Sth
- 18McShaneSubstituted forDzierzawskiat 73'minutes
- 26FowlerBooked at 85mins
- 10ReillySubstituted forLyleat 73'minutes
- 11RussellBooked at 29minsSubstituted forSmithat 78'minutes
- 2SivesBooked at 66mins
- 14GallagherBooked at 32mins
- 9OglebySubstituted forWhiteat 69'minutes
- 20MullenSubstituted forRobertsonat 105'minutes
- 19GlenSubstituted forHippolyteat 70'minutes
- Craig Charleston
- Shots on Target