Kevin Harper scored three minutes from time to grab his first goal for Dunfermline Athletic as the 10-man Pars rallied to beat Stirling Albion.
Derek Lilley missed a great chance for Stirling and Albion keeper Myles Hogarth denied Stevie Crawford.
But Jim Hamilton headed in Crawford's cross, only for Scott Morrison to be sent off for hauling down Steven Bell.
Chris Aitken scored from the spot before Harper converted a Darren Young cross for a late winner.
Dunfermline: Gallacher, Shields, Wilson, Young, Scott Morrison, Scott Thomson, Harper, Crawford, Hamilton, Glass, Owen Morrison.
Subs Not Used: Simmons, McGuire, Ryan, Woods, Murdoch.
Sent Off: Scott Morrison (72). Booked: Hamilton, Wilson.
Goals: Hamilton 55, Harper 87.
Stirling: Hogarth, Nugent, Devine, Ellis, Graham, Aitken, Bell, Murphy (Tomana 72), Lilley, McKenna (Cramb 60), Taggart (Harris 60).
Subs Not Used: Gribben, Christie.
Booked: Devine, Aitken, Ellis, Nugent, Tomana.
Goal: Aitken 73 pen.
Ref: S Finnie