The hosts almost took the lead when Tommy Smith picked out Harry Bunn but his long-range shot deflected wide.
Dean Whitehead later fouled Forestieri and Ross Wallace forced Terriers 'keeper Jed Steer into a fine save.
The visitors stole all three points with seven minutes left when Lucas Joao crossed for Forestieri to slide home.
In a nervy local derby of few chances prior to Forestieri's 83rd-minute winner, the Owls could have broken the deadlock earlier on were it not for Joel Lynch clearing Aiden McGeady's effort off the line.
The result meant that play-off hopefuls Wednesday rose to fifth place, aided by Derby's 2-1 defeat at Cardiff.
It was also Wednesday's third successive league victory, while Huddersfield missed the chance to take another step closer to sealing their Championship safety and dropped to 18th in the table.
Huddersfield head coach David Wagner:
"We restricted them to two chances and they scored one. We were unable to create chances ourselves and it was clear the first team to score would win the game.
"It was an interesting tactical game by two good sides. Our defence was good but we did not cause them enough problems.
"It hurts to concede after 83 minutes but it happens and it's an experience we must learn from.
"We saw there is a distance between us and the top six teams but we will get closer."
Sheffield Wednesday boss Carlos Carvalhal:
"The players were unbelievable. Our players are focused and they are doing exactly what we intended for them to do.
"We knew we would get our moment and when that moment came Forestieri took his chance.
"We fought for the points and our defensive organisation was almost perfect. We don't care about clean sheets. We want to create chances and score goals.
"I understand everybody is excited but the players are in the dressing room sipping water and everything is quiet. Nothing has changed."
Fernando Forestieri's late close-range strike gifted Sheffield Wednesday victory over Yorkshire rivals Huddersfield Town.