Glenavon secured their first away win in the league since October thanks to Mark Patton's late goal at Ferney Park.
Patton side-footed in the winner from six yards just three minutes from time after Andy McGrory had delivered the ball from the right.
Glenavon had taken an early lead when new man Tiarnan Mulvenna headed in at the far post from Kyle Neill's corner.
Ballinamallard levelled through skipper Mark Stafford's header on 31 minutes.
Stafford got on the end of David Kee's inswinging free-kick to score what was only Ballinamallard's fourth goal in eight matches.
Glenavon thought they had been awarded a penalty when an assistant appeared to flag for a foul by Nigel Beacom on player-boss Gary Hamilton, but referee Hugh Carvill did not view it as an offence.
Hamilton was substituted later in the game but was subsequently sent-off by ref Carvill for comments made from the touchline.