Brad McKay put the visitors in front with ten minutes left of the first half after Michael Moffat had touched on a corner.
However, Mark McGuigan equalised four minutes into the second half after he reacted to Ryan Thomson’s pass to lash the ball home.
Craig Malcolm headed Stranraer in front from a corner and before Dunfermline could recover, Andy Stirling added the third, again from a corner kick. Malcolm made sure of the points with a shot on the turn to take the game well out of Dunfermline’s reach.
Meanwhile, Robert Thomson hit a hat-trick as Brechin overpowered Peterhead 5-1 at Glebe Park to move off the bottom.
Andy Jackson gave Brechin an early lead after Thomson flicked the ball on.
Thomson then doubled Brechin’s advantage when he lobbed the ball home before Nathan Blockley pulled a goal back for Peterhead with a solo effort from his own half. Liam Watt restored Brechin’s two-goal advantage and then set up Thomson for his second just before half-time.
Thomson completed his hat-trick midway through the second half.
Airdrie sent Forfar to the bottom of the league with a 2-0 win at Station Park. Alan Lithgow gave Airdrie a 10th-minute lead and Jim Lister made it 2-0 shortly before half-time.
Ayr United closed the gap on Peterhead with a 4-0 win at Stenhousemuir.
Michael Donald fired Ayr in front in the opening minute and Craig Moore added the second shortly after half-time. A late double from Jordan Preston, one from the penalty spot, made sure of the points.
Albion Rovers confirmed their League One status with a 0-0 home draw against Cowdenbeath, but their play-off hopes remain slim.