A super strike by David Graham with only seven minutes left gave Stranraer a great win in a match largely dominated by defences and one in which Ayr were on top for long stages.
The visitors matched Stranraer from the kick-off and gave them very few chances to move forward. Their own service to their strikeforce was more positive in the early stages and on 24 minutes it paid off for them with a goal from Stewart Kean.
Willy Lyle had sent over a deep cross and Kean turned sharply and smartly to send Murray Henderson the wrong way before hitting the net from close range.
The home side came more into things but still failed to push forward enough and threaten the Ayr goal.
After the break, when the game seemed to be dying slightly, it suddenly burst into life with an equaliser from Graham.
Ayr's Mark Smyth hesitated in covering a long throughball and Graham pounced on the free gift to slide it neatly inside the near post as keeper Ludovic Roy came out.
Stranraer fans were delighted and in a now evenly balanced game had even more cause for celebration when with seven minutes left Graham grabbed the winner - easily the best goal seen at Stair Park for a long time.
Graham picked up the ball just inside the Ayr half, beat one man, slid between two defenders, side-stepped another, and hit a superb winner from around 22 yards which gave the Ayr keeper no chance.