Ballinamallard United moved above Dungannon Swifts into eighth place in the Premiership table thanks to their first league win since October.
James McKenna slotted home from Ivan Sproule's cross and then debutant Stephen O'Flynn scored with a 25-yard deflected free-kick before half-time.
Matthew Tipton nodded in from six yards after the break to give United hope.
Ryan Campbell prodded in, Jason McCartney added a 62nd-minute penalty and Leroy Millar then pulled one back.
Ballymena had won five of their last six matches against the Mallards but never looked like taking anything from this game.
McKenna's 32nd-minute opener set the wheels in motion as home manager Whitey Anderson watched from the stand because of a suspension.
O'Flynn, on loan from Crusaders, beat Blayney to add the second in the 43rd, but Tipton's headed effort less than a minute after the interval reduced the visitors' deficit.
Campbell's goal from a Sproule cross on 57 minutes gave the Fermanagh side some breathing space and McCartney made no mistake from the spot after David Elliott had been fouled in the area by Kyle McVey.
Substitute Millar fired home in added time for a late consolation.