Quaner's last-gasp effort ended Preston's slim hopes of making the play-offs and saved Australia midfielder Mooy's blushes after goalkeeper Chris Maxwell kept out his spot-kick.
The result pushes the West Yorkshire team closer to a play-off place themselves - and keeps alive their outside hopes of claiming automatic promotion.
The contest looked set to end in a draw when there was confusion deep into added time.
Jordan Hugill, who had just made it 2-2, brought down Elias Kachunga but - amid furious protests - referee Lee Probert took an age to give the penalty.
Maxwell was booked for time-wasting before Mooy was finally able to take the spot-kick. Maxwell dived to his left to push away the effort - only for Quaner, an 86th minute substitute, to fire home the rebound.
Town, beaten in three of their previous four matches, had gone behind to Aiden McGeady's strike.
Kachunga equalised before half-time before Jack Payne put Town ahead in the 70th minute. Hugill made it 2-2, only for Quaner to win it.