Honest Austin McCann admitted Stranraer should have had a penalty‚ seconds before Ayr grabbed an injury time winner.
Another Michael Moffat double got United out of jail to climb them to fourth and leave the visitors feeling blue.
Stranraer were raging when Kyle McAusland clearly held back Craig Malcolm in the box with only seconds of normal time left.
But ref Gary Hilland, who had a nightmare afternoon, unbelievably waved play on and Ayr dashed upfield to win it.
McCann revealed: “I said to the wee striker at the end that it was a stonewaller. But, over the course of the game, we deserved to win.
“We might have got a wee bit of luck at the end but we were the better team. Over the course of the season, we’ll need to grind out results and we did that.
“If we are to have success, we have to be strong at home so I’m pleased we are dominating at Somerset Park.
“Now we need to push on and try to keep in touch with Queen of the South.”
Boss Mark Roberts admitted that Ayr got lucky with Moffat’s winner after the striker used a hand in the build-up.
He added: “We have taken games almost to the last kick a couple of times this season but that’s the best time to score.
“The tackle on me was definitely a penalty. Their boys ran up to me and said I dived but I didn’t.
“Sometimes you don’t get what you deserve but we did today. We were by far the better team and dominated possession.
“At half-time, I told the boys to be patient and we would win it. I have so much belief in them.”
Michael Moore gave Stranraer the lead in 31 minutes after Ally Brown could only push out a 25-yard free-kick from Mark Staunton.
The visitors were fuming when Grant Gallagher was ruled to have fouled Roberts for an 57th-minute penalty which Moffat stuck away.
The game boiled over with seven minutes to go when Ryan McStay got a straight red after retaliating on Moore, who was booked.
Then came the penalty claim when McAusland hauled back Malcolm but the ref waved aside the claims.
To rub salt into Stranraer’s wounds, Moffat raced on to a long ball and appeared to use a hand as he rounded keeper David Mitchell who missed his attempted punched clearance.
That left Moffat a simple task of rolling his 12th goal of the season into an empty net.
It gave Ayr yet another late, late win for which they are becoming renowned. Teenager Robbie Crawford was again a driving force in midfield and walked off with the man of the match award.
The Moff is on fire and well on course to break through the 20 goals barrier for the season. His workrate, even off the ball, is giving defences a torrid time.
Blues boss Stevie Aitken hit out: “How the ref could give Ayr a penalty and then not give one at the end is baffling.
“Having sent off an Ayr player, there is a wee bit of pressure on him and I basically think he bottled it. It was a stonewall penalty.
“It is extremely disappointing to walk away with nothing. We certainly didn’t deserve that.”