Nahki Wells put the Terriers in front, but Johnny Russell equalised before Joel Lynch was sent off for two yellow cards.
And after goalkeeper Alex Smithies slapped the ball into his own net, skipper Peter Clarke was also dismissed as Chris Martin sealed victory from the penalty spot with his 21st goal of the season.
It puts Derby 11 points clear of seventh place with four games to go, and means Huddersfield still have work to do to pull clear of the drop zone after a third consecutive defeat.
Derby had started with the confidence of a team almost guaranteed a top-six finish, and they nearly scored in the third minute when a Russell volley from outside the area was blocked one-handed by Smithies and Richard Keogh scooped the rebound over the bar.
Clarke was booked two minutes later for a deliberate trip which halted a Will Hughes run, but the visitors had claims for a penalty waved aside by referee Darren Deadman when Danny Ward went over in the ninth minute.
However, Ward was smiling five minutes later when he provided the low cross from the right which travelled all the way to the back post, where Wells had a simple tap-in from two yards.
Derby almost conceded again in the 20th minute when a mistake by Keogh allowed Wells to run into the box, but Lee Grant raced out to deny the striker his second goal.
It was a big moment because, eight minutes later, Derby were level when a George Thorne pass sliced Huddersfield open and Russell cleverly flicked the ball over Smithies from just inside the box.
Huddersfield were reduced to 10 men two minutes before the interval when Lynch, who had already been booked for time wasting, caught Patrick Bamford late on the left touchline and was shown a second yellow card.
Bamford was able to continue after treatment and wasted a great chance when he blazed over from 10 yards, but the advantage was now with Derby and they were literally given a helping hand by Smithies in the 50th minute.
A cross from Craig Forsyth was totally misjudged by the keeper, who palmed the ball one-handed into his own net.
And it got even worse for Huddersfield, who had Clarke sent off for the foul which also earned Derby a penalty.
The defender clearly caught Hughes and, after Clarke had been shown his second yellow, Martin sent Smithies the wrong way with a spot-kick into the bottom left corner.