First-half goals by Nicky Clark and Andy Geggan were enough to kill off a battling home team whose lack of a cutting edge was apparent as they blew a host of chances.
Pars manager Allan Johnston believes his team have left their early season failings behind them and are now reaching for the play-offs.
Johnston said: “We made mistakes at the start of the season but the boys have now stepped it up. It always helps when you have good finishers.”
Alan Forrest, Nicky Devlin and Gary Harkins all went close early on for Ayr but it was the Fifers who showed them the way to goal after 26 minutes.
Michael Moffat and Jason Talbot combined and Clark diverted the ball into the bottom corner.
Dunfermline doubled their advantage when a Kallum Higginbotham corner broke to Geggan who hooked the ball home.
Kevin Nisbet fired two efforts high and wide as Ayr tried to reply before the interval while Higginbotham shot over for the visitors.
United looked for a response at the start of the second half and they almost got it when a Jamie Adams header was superbly touched over by Sean Murdoch.
Robbie Crawford made a goalline clearance to keep out Lee Ashcroft’s header as the Pars went close to a third on the break.
Ayr manager Ian McCall said: “It seems we need ten to 15 good openings to score a goal..”