Alloa moved off the foot of the Championship after a dramatic winner by substitute Jordan Kirkpatrick three minutes into stoppage time.
Queen of the South almost went in front after 11 minutes when Andy Stirling picked out Lyndon Dykes in space but his 15-yard effort was cleared off the line by Alloa captain Andy Graham.
Jim Goodwin’s Wasps, who ended a run of five successive defeats in all competitions, were denied in 17 minutes when Queens goalkeeper Alan Martin brilliantly turned over a 12-yard volley from Dario Zanatta. But from the resultant corner by Iain Flannigan the ball landed perfectly for Graham to volley past Martin.
Queens levelled in 59 minutes when Scott Mercer’s corner was met by Kyle Jacobs. His header was superbly saved by goalkeeper Neil Parry, but the midfielder followed up to crack home the rebound. Stephen Dobbie had the ball in the net two minutes later for Queens, but was ruled offside.
Alloa grabbed the winner when Kirkpatrick headed home from a Zanatta cross.