It took just four minutes for Inverurie to break the deadlock as Dean Donaldson tested the defence down the right flank before passing to Martin Bavidge. The striker expertly controlled the ball with his right foot before firing an shot across goal with his left into the back of the net.
Locos continued to apply pressure until Jordan Leyden found space in midfield to advance on goal. He saw his low 20-yard shot deflected by Bryan Bell on to the crossbar.
It was immediately clear that Inverurie could not afford to squander this kind of opportunity as Lossiemouth put together a fine string of passes which saw enough space created for Scott Miller on the edge of the box to move off his defender and pick his spot, only to see his effort flick off the outside of the far post.
As the half continued, Inverurie failed to capitalise on their opportunities as Lossiemouth dug in to keep the game within a goal. First, Neil McLean saw his close-range effort off a short Leyden free-kick clip off the crossbar, before Chris Ross came to the rescue to clear a Leyden effort off the line.
As half-time approached, Lossiemouth finally tested keeper Ryan Booth, forcing the Locos man to produce a fine save as Miller flicked a precision header off a cross from the right, which looked to be heading for the far top corner, until Booth somehow pushed it wide.
Lossie came out of the break looking to pressure the Locos defence and William Mathers ran on to a long ball down the left flank, only to see his resulting shot to the near post be smothered by Booth.
Inverurie weathered this period and began to dominate possession, with Lossiemouth's stubborn defence frustrating the home side until an inspired substitution saw Greg Mitchell come on for Locos and he quickly double their advantage. After just four minutes on the field, Mitchell found himself with space in the box to drive Laing's low pass across goal, leaving Farquhar rooted to the spot.
Lossiemouth refused to give up and when Locos failed to clear the danger from a Lossiemouth corner, Ross Duncan clipped the ball towards the back post where Miller provided a flicked header which looped over Booth and snuck in under the crossbar.
Completing the most thrilling of turnarounds, Martin Charlesworth then picked his spot from the edge of the box, almost passing the ball into the far left corner, sparking huge celebrations from the away bench.