Franck Moussa's scrappy winner in the 83rd minute secured victory for Coventry City against Gillingham as the home side extended their unbeaten run to six games.
Coventry got off to a flying start in the League One encounter as Leon Clarke finished calmly in the second minute to score his fifth goal of the season.
However, their joy was short-lived as Cody McDonald fired home against his former club with 10 minutes gone.
Clarke continued to threaten for the hosts, but Adam Barrett and goalkeeper Stuart Nelson threw themselves in front of a number of fierce efforts to keep the scores level.
Coventry continued the second half as they had ended the first, with Clarke and Carl Baker both striking the woodwork.
Clarke was a nuisance to the visitors' defence all afternoon and was denied once more when his shot crashed against the frame of the goal.
With seven minutes remaining, Moussa, who was earlier denied superbly by Nelson, bundled the ball home to lift Coventry out of the relegation zone.
There was still time for Clarke to be denied yet again by another outstanding Nelson save, but he ended the game with just one goal.