They owe their semi-final advantage to clinical finishing by Mark McGuigan, Willie Gibson and Andy Stirling.
McGuigan and Gibson both scored twice, with Stirling hitting the net in style with a 20-yard screamer.
Livingston had led through Jordan White and Liam Buchanan's header helped reduce the deficit in the second half.
When White's 15th goal of the season put Livi ahead from eight yards early on, few would have predicted a final score of 5-2 to the hosts.
But a controlled side-footed finish by McGuigan, Stirling's lovely left-foot strike and a sublime low, curled free-kick by Gibson meant the Blues were 3-1 up at the break.
Stranraer were under pressure at the start of the second-half and Livingston's Buchanan popped up with a header to reduce the deficit.
But two minutes later McGuigan pounced to finish off Craig Malcolm's effort that had come back off a post, then the in-form Gibson's low centre found its way into the back of the net via a deflection.
Livi goalkeeper Marc McCallum saved well from Calvin Kemp and Kyle Turner in added time to prevent Stranraer increasing their lead further.
Stranraer put five goals past Livingston to give themselves a brilliant chance of reaching the Championship play-off final.