Dunfermline took the spoils in the Fife derby as Andy Geggan's goal earned a 1-0 victory over Raith Rovers.