The Buddies fielded a fairly strong team with Darren McGregor and Lee Mair in defence with youngsters Christopher Dilo, Sean Kelly, Anton Brady, Thomas Reilly also starting.
Jon Scullion gave Saints the lead at half-time and Reilly doubled it after the break, only for the Pars to level through two penalies. Robert Thomson scored the winner with just minutes remaining, although there was still time for Dunfermline's Stephen Husband to be sent off.
Follow Mirren Mad on Facebook at http://www.facebook.com/mirrenmad
Follow Mirren Mad on Twitter @mirren_mad or http://www.twitter.com/mirren_mad