Two goals from HuddersfieldÂ’s leading scorer Martin Smith gave the Terriers their first win in nine games.
Smith struck in the 27th and 83rd minutes to earn his side a fifth win of the season and ease the pressure on his under-fire boss Mick Wadsworth.
Stockport struggled to get going in the opening period against a Town side playing with a confidence not seen in recent weeks.
The visitors had the best early chance, but Luke Beckett squandered it after being put through by Ben Burgess.
Three minutes later Smith punished a poor clearance by Lee Jones which was picked up in midfield by Kenny Irons, who ran into the box and pulled the ball back across the area. Jones parried but Smith pounced to stroke the ball home for his sixth of the season.
Beckett was guilty of missing another good chance after 37 minutes, heading over when it looked easier to score.
Smith and Lee Ashcroft again went close for Town, but they were guilty of sitting back on their lead as County came into it more.
Substitute John Hardiker almost equalised with a neat header, which was palmed onto the post by Scott Bevan.
But they were not to be denied and equalised after 73 minutes when another substitute Keith Briggs was quickest to react to Aaron Lescott's header and, as Bevan came off his line, Briggs headed it home.
Rickie LambertÂ’s powerful free kick was tipped away by Bevan, but that was as close as Stockport got to a winner.
Town broke up field, and BoothÂ’s header landed in space in the area and Smith ran on to fire an unstoppable shot past Jones for the winner.