The home side had taken the lead through Mark McGuigan in a feisty match which was peppered with eight bookings.
But Docherty's late shot from inside the box levelled the tie again.
The two sides meet again for the second leg at Somerset Park on Sunday afternoon, with the eventual winner gaining promotion to the second tier.
Ayr's Greg Fleming produced a quite stunning save from a thundering Ryan Thomson shot, which appeared netbound until the goalkeeper launched himself to his left and diverted with the strongest of hands.
Fleming's team-mate Ross McCrorie blundered at the other end. Unmarked six yards out, he had all the time in the world to finish but rushed his effort and totally missed the target.
A swift Stranraer counter-attack led to the opener as Andy Stirling, the outstanding player on show, fed McGuigan to finish low and with precision.
The hosts could have scored a second in a bizarre sequence of play which began with an Ayr player having his jersey pulled as he took a throw-in by a Stranraer fan leaning over the wall.
The home team broke and Ayr keeper Fleming totally misread a header outside his box. The ball deflected to Jamie Longworth, whose shot was eventually cleared.
And then Docherty levelled the tie again seconds before the final whistle.
It was indeed a weird and wonderful night and sets up a fascinating showdown on Sunday.
A stunning stoppage-time strike by Ayr United's Ross Docherty denied Stranraer a first-leg advantage in the Scottish Championship play-off final.