McAleer struck the only goal for the league's bottom side after 19 minutes, taking a pass from Nathan Blockley before firing in a magnificent 25-yard shot.
Jamie Bain almost added a second shortly afterwards when he saw a deflected shot slip inches past the post, but then came the inevitable Dunfermline response, with Allan Smith twice going close.
Dunfermline continued to press in the second half but Grant Adam made a fine double save from Josh Falkingham and Laurence Shankland late in the game.
Arbroath kept above Airdrie with a 2-1 win over Stenhousemuir, coming from behind after Darren Smith's opener.
Chris Scott hit back before half-time and Dale Robertson got the winning goal with three minutes left.
Brechin City beat Ayr United 3-1 at Somerset Park. Gerry McLaughlan gave them an early lead, before Kyle McAusland scored an own goal.
Gordon Pope pulled one back but Graham Hay had the final say with a third for Brechin in injury-time.
Stranraer's match with East Fife was postponed due to a waterlogged pitch.