Ballinamallard boosted their hopes of avoiding a potential relegation play-off as they defeated fellow strugglers Coleraine in a fiery Ferney Park game.
Both teams were reduced to 10 men in the closing moments as Coleraine's Stephen Lowry and Ballinamallard's David Kee were sent off.
Lowry was adjudged to have stamped on Kee who received a second yellow card.
Ryan Campbell's 53rd-minute goal was cancelled out by Gareth Tommons  before Richard Lecky's winner .
Campbell had missed a couple of first-half chances for Whitey Anderson's outfit with Tommons and David McDaid squandering great Coleraine opportunities at the other end.
Campbell struck the Mallards ahead on 53 after being played in by Jason McCartney.
Tommons atoned for his first-half missed as he half-volleyed in a 64th-minute equaliser but Lecky's goal 15 minutes later secured the points for Ballinamallard.
The game boiled over in injury-time as Lowry received his straight red card for his apparent stamp on Kee who was himself sent off after getting a second yellow card for his response.
The win moves the Mallards three points ahead of Warrenpoint, who currently occupy the relegation play-off spot.
Coleraine's defeat means they are still dangerously near the relegation mix as they are only four points ahead of Warrenpoint.