Livingston were held to a draw after a last-minute Dunfermline penalty meant a share of the points.
Livi dominated the first half and were very unlucky to go into the break a goal down, with a rare Pars chance being put away by a Ryan Thomson's header.
The Lions battled back after the break, with Tony Andreu pulling Livi level.
And super sub Marc McNulty fired Livingston into the lead.
But with the points looking safe, Danny Mullen gave away a late penalty, and Stephen Husband netted from the spot.
Livingston remain third and Dunfermline stay fourth.
McNeil, McCann (McNulty 46), Talbot, Garcia Tena, Barr, O'Brien, Ky.Jacobs, Fox (Donaldson 85), Andreu, Scougall (Mullen 65), I.Russell
Subs not used: Booth, Jamieson
Hrivnak, Millen, Whittle, Young, Potter (Byrne 52), Kane, Dargo (Munro 56), Husband, Wallace (Smith 45), Falkingham, Thomson
Subs not used: Drummond, Goodfellow
Referee: Paul Robertson
Official Attendance: 1465
Match report: Kieran Westbrook
Pictures: Steven Carrie