The Latics had enjoyed the better of a tight first half but, from their best chance, James McClean’s header was superbly tipped over the top by Lee Grant.
Derby made a change at the break, sending on Martin for Jamie Ward, and the big striker notched within six minutes.
Johnny Russell did well down the left, and Martin was on hand to smash past Ali Al Habsi to the delight of the home fans behind the goal.
Wigan tried to get back on level terms but lacked the sufficient quality in the final third to trouble the Rams.
They were put out of their misery with nine minutes remaining when Russell’s cross was finished off in clinical fashion by Bent – and Mackay’s controversial five-month reign was ended after the match.
The Rams had to withstand some concerted pressure from Wigan in the opening stages, with the home side looking to give themselves a lifeline at the bottom.
Richard Keogh headed just over his own bar from one corner by Kim Bo-Kyung, while Derby nearly scored from the South Korean’s next set-piece delivery.
Thomas Ince led a break and managed to get goalside of Gaetan Bong, but fired weakly straight at Al Habsi.
Wigan came desperately close to taking the lead nine minutes before half-time when McClean’s powerful header was magnificently repelled by Grant at the expense of a corner.
The visitors would have been relatively pleased to get in at the break on level terms after struggling to get going.
But after the introduction of Martin, they looked a different side after the break.
The Scotland international edged his side in front with a superb finish, and his physical presence up top kept the home defenders constantly on edge.
Despite the second-half introductions of Chris McCann, Josh Murphy and Martyn Waghorn, Wigan could not muster what would have been a crucial goal in their relegation battle.
Grant was perhaps fortunate when McClean headed straight at him after Murphy’s shot deflected into his path in the final quarter.
But it was game over with nine minutes remaining when Bent rifled home past an exposed Al Habsi to secure the points.
And Wigan’s attempts at even a consolation were thwarted when Grant did well to keep out a daisy-cutter from Kim as the Rams reignited their promotion push.
A statement on Wigan’s official website after the match confirmed Mackay’s exit, with Sharpe explaining: “This was a very difficult decision to make but I feel that for the long-term future of the club, there needs to be change now.”