16 year old Alan Forrest proved to be United’s hero at Hampden Park after he scored the winner three minutes from time.
United found themselves 1-0 down in the first half through a penalty but strikes from Moffat and Forrest allowed Ayr to progress to the Second Round of the Ramsdens Cup.
Ayr will find out who they will face in the next stage of the cup on Wednesday.
United made two changes from the side that defeated Cumnock Juniors with trialist, Martyn Campbell coming in for newly signed Josh McArthur and Craig Malcolm beginning the game in place of Alan Forrest.
In their striking new red away kit, United stormed forward in the early stages, terrorising the Queen’s Park rear guard.
Robbie Crawford looked keen to notch his first goal for United and was close to doing so when he saw a 25 yard thumping drive saved.
Moffat was also close to opening the scoring with a left footed shot which was saved at the near post.
Craig Malcolm looked dangerous and he could count himself unlucky not to score after he saw his raking shot fly by Michael Brown’s far post.
After 25 minutes, Queen’s Park won a penalty when Gordon Pope handled the ball in the area. Tony Quinn then put the home side into the lead even though Hutton dived the correct way.
On his first start since his gruelling injury, Martyn Campbell was back to his commanding best and even posed a threat going forward, seeing a bicycle kick blocked after half an hour.
After 52 minutes, United received their just rewards when Michael Moffat levelled the scores. A long ball from Martyn Campbell allowed Moffat to sneak in behind the Queen’s Park rear guard and fire beyond Michael Brown.
United continued to pile forward with Gordon Pope seeing a drive fly wide of the target.
After 78 minutes, United had the ball in the back of the net through Michael Moffat. However, Craig Malcolm was adjudged to have handled the ball before he crossed into the box.
Mark Roberts expressed anger at the decision and was sent to the stands for his protests.
Ayr didn’t relent though and with 3 minutes remaining, they took a 2-1 lead thanks to a strike from substitute Alan Forrest who prodded home, becoming the youngest player ever to score for the club.
After the match, an upbeat Mark Roberts said: “Over the course of the 90 minutes I thought we totally and utterly deserved to win the game.
“I was disappointed by the penalty decision as we had a similar claim shortly before their spot kick was awarded.
“I couldn’t believe we were down at half time as we had by far the better chances but I was always confident our guys would respond in the right way and they did that.
“We scored two great goals through Moffat and Alan Forrest who is a sublime footballer.
“I want my subs to make an impact this season and Alan has shown the way. He’s been outstanding for the last four weeks of pre-season and I’m delighted for him.”
Alan Forrest said: “I can’t believe I scored the winner. I was going to square the ball across the box but I saw the goalkeeper fall so I thought I might as well shoot and thankfully it went in.
“I always thought we would win the game but I wasn’t sure if it was going to go to extra time or not so I was delighted to score.”
Queen’s Park: Brown, Gallacher, Coll, Grier, Brough, Rooney, Spittal, Anderson, Vitoria, Quinn, Burns(Davison). Subs: Capuano, Keenan, Trialist, Lochhead.
Ayr United: Hutton, Hunter (Trialist), Pope, Campbell (Trialist), Lithgow, McLaughlin, McGowan (Forrest), Crawford, Moffat, Malcolm, Donald. Subs: Shankland, Forrest, McArthur, Marenghi, Muir.
Referee: Paul Robertson
Assistants: MacMillan, Stewart
By Michael Lamont
Thanks to Queen’s Park photography and David Sargent.