A dramatic late equaliser at Somerset Park gave Brechin a great chance of winning this first division play-off.
After Michael Moffat had put Ayr in front on 30 minutes, Jim Weir’s men survived a second-half onslaught, with veteran keeper Craig Nelson making save after save.
The best it looked like they could hope for was a slender deficit for the return leg at Glebe Park but a bizarre equaliser from substitute Neil Janczyka free-kick that went straight inset up a 90-minute winner-takes-all shoot-out on Sunday.
Brechin boss Weir admitted his side dodged a bullet in Ayrshire. He said, “With five minutes to go, or even 15, I’d definitely have taken a 1-0 defeat. Craig Nelson has made some tremendous saves.
“Maybe the draw wasn’t deserved but you have to take the breaks when they come your way. The tie is still in the balance and hopefully the people of Brechin will get behind us. We’ve got a realistic chance of getting first division football.”
Ayr manager Brian Reid commented, “We should have been three up but we’ll get ourselves up for Sunday and our fans will outnumber them three or four to one so it will be like a home game.”
Brechin’s Gerry McLauchlan passed a fitness test so was able to take his place in the starting line-up. The only change to the team which beat Cowdenbeath at the weekend was Paul McLean for late withdrawal Roy McBain.
Both sides struggled to get into their stride in the opening stages and it was nine minutes before a chance was created.
Jim Lauchlan floated over a cross from the right for Stuart Bannigan to attack but he mistimed his leap and couldn’t manage to get a header on target.
Brechin were finding it hard to get decent service in to their two front men but midfielder Craig Molloy was able to do just that on 12 minutes when he threaded a pass through the middle for David McKenna.
Unfortunately, his first touch on the 18-yard line let him down and the Ayr defence snuffed out the attack.
The visitors were now getting a good foothold in the match and forced a succession of corners over the next 10 minutes. They were all taken by Jordan Kirkpatrick but no clear-cut chances came from any of them.
Midway through the half Mitch Megginson showed superb skill to nutmeg Chris Smith on the Brechin right. He then drove into the box but his cut-back was behind Rory McAllister who had charged towards the near post.
Just when Ayr and their supporters looked to be getting frustrated with the way the game was panning out, they managed to break the deadlock with a moment of individual brilliance from Moffat.
The striker created space in the box on the half-hour, beating two Brechin defenders, and gave keeper Nelson no chance with a clinical finish, his 10th of the season.
The opener had turned the tide and an Ayr second now looked likelier than a Brechin equaliser.
The goalscorer was again in the thick of the action on 37 minutes. After a surge through midfield from Alan Trouten, the ball found its way to Moffat on the edge of the box. He attempted to lob Nelson and find the far top corner but his effort was overhit and it sailed over.
Five minutes after the restart Ayr nearly made it 2-0. Scott McLaughlin cut in from the right on to his left foot and his curled shot looked to be destined for the far corner, only to be diverted wide by a fingertip save from Nelson at full stretch.
Just three minutes later, Weir made a change, sending Gary Fusco on for Kirkpatrick.
Moffat took advantage of slack defending from McLauchlan and just as he was about to pull the trigger out came a hand from Nelson to prevent a certain goal.
The former Ayr man was having an outstanding spell of goalkeeping and just before the hour mark he denied Mark Roberts with a point-blank save.
It was now virtually one-way traffic and on 67 minutes Nelson was again called into action, this time keeping out a fierce Moffat 18-yard strike.
Just as Brechin looked like they would have to settle for going into the second leg a goal down, on 86 minutes substitute Janczyk sent over a free-kick from the right touchline which found its way all the way into the net.
In the dying moments McAllister nearly found a winner but his shot was smothered by Martin.
There was still time for Ayr but they squandered a great free-kick position at the edge of the box in stoppage time.