The Queens youngsters won 5-4 in a tie that lasted more than four hours after fans in the Jerry Kerr Stand were evacuated when a fire alarm went off before the game went into extra time after a 4-4 draw.
The SPL side took the lead after just eight minutes through Ryan Gauld, with the Dumfries youngsters levelling midway through the first half when Paddy Slatterly netted direct from a corner.
Gauld edged United in front again before the game was held up for almost an hour as two fire engines attended the ground due to an alarm being raised just before half time. When the game got going again, the several hundred fans were moved to the George Fox Stand.
Queens restarted the quickest, with Lewis Todd scoring from distance on 49 minutes. However, Robert Thomson’s double had United 4-2 in front with just over an hour played.
Slatterly fired his side back into things with eight minutes left and five minutes later Scott Hooper levelled from the penalty spot after the home side’s Craig Bell was dismissed.
The visitors booked their place at the National Stadium when Gavin Reilly netted in the last minute of the first half of extra time. United finished the match with nine men after John Soutar was sent off.