Stephen Husband slotted home a 67th-minute penalty as Dunfermline secured a 1-0 win over Cowdenbeath at East End Park.
Husband fired the ball down the middle of the goal to leave away goalkeeper Thomas Flynn with no chance after Alan Smith was brought down in the area.
The Pars began strongly and had the ball in the back of the net when Ryan Thomson looked to have scored, only for the goal' to be disallowed for offside.
Husband then fired a 30-yard free-kick just wide of the target after Smith was fouled.
Cowdenbeath struggled to impose themselves on the game in the opening period but they came out with renewed vigour after the break, with Dunfermline keeper Michal Hrivnak forced to dive in at the feet of Craig Moore.
Hrivnak's opposite number Flynn then had to be sharp to parry an effort from Smith after he found himself one-on-one, with Flynn also doing well to keep out Ryan Thomson's follow-up effort.
Flynn continued to be kept busy and again did well to deny Chris Kane, who shot goalbound after Shaun Byrne had laid the ball back to him.
Dunfermline's patience paid off though and they eventually took the lead through Husband, who kept his nerve to sot home the winning penalty after the wind had initially blown the ball off the spot.
The away side pressed in the closing stages but were unable to force an equaliser, with the Pars leapfrogging them in the First Division table to leave Cowdenbeath in the relegation play-off place.
The Latics had the best chance of a scrappy first half but Matt Smith headed over from David Mellor's cross.
Crawley's Billy Clarke had a near-post effort blocked by home goalkeeper Dean Bouzanis, who also had to grab a deflection off Smith that threatened to find his own net.
It was Smith who gave Oldham a 56th-minute lead - his third goal in consecutive games - as he bundled through the heart of Crawley's defence and hit a 20-yard drive into the bottom corner of the net.
Robbie Simpson almost added a second but the visitors equalised after 77 minutes when a short corner routine ended with defender Mark Connolly heading in from point-blank range.
Oldham snatched victory in injury time as Jose Baxter's free-kick to the far post was headed in from three yards out by Jean Yves Mvoto.