Goals from Danny Ward and Lee Novak had put the visitors in control but Boro put themselves back in a play-off place with a superb fightback that even saw them miss a penalty.
After a dull first half, promotion-chasing Huddersfield went ahead five minutes after the restart when Novak pounced on a loose ball by Stacy Long before playing in Ward and he finished through substitute goalkeeper Alan Julian's legs.
The Terriers doubled their lead five minutes later when Novak took aim from 25 yards and his rising strike flew over Julian.
Stevenage pulled one back as Michael Bostwick rose to powerfully head in Joel Byrom's corner but they looked to have missed out when Alex Smithies saved Scott Laird's penalty after Gary Naysmith fouled Lawrie Wilson.
But the home fans were sent wild with two minutes left as Shroot arrived at the back post to fire Jennison Myrie-Williams' cross into the roof of the net.