At one point it looked like Town would pull off a Cup upset at St. James Park as Lee Clark's side took a 3-1 lead early in the second half, but Championship side Newcastle United's star-studded bench sprang into action and guided the Magpies into the hat for the Third Round after a brilliant encounter.
A brace from Theo Robinson and a Jordan Rhodes strike gave the Terriers the lead going into the 47th minute and although Newcastle came out on top over the 90 minutes, it was the near 4,000 travelling fans who were singing loud and proud at the final whistle.
The home side made an early break down the left flank when LuaLua was the beneficiary of a lucky ricochet off the shins of Lee Peltier. The winger drove into the penalty area before hammering the ball low across goal, but skipper Clarke was on hand to clear to safety.
Town started the game brightly too and one early cross-field pass from Drinkwater almost set Jordan Rhodes in on 'keeper Tim Krul's goal.
The Magpies enjoyed the majority of possession in the early stages of the game, but the Terriers threatened in the 9th minute when Robinson beat two defenders for pace down the right side. His cross looked good, but was gathered in by the goalkeeper as Rhodes looked to poach a goal.
At the other end, Kazenga LuaLua blazed high and wide with a very speculative shot from 30-yards out.
The hosts created a good break down the left again in the 17th minute when full-back Enrique found space on the overlap to cross, but midfielder Guthrie placed his close range shot wide of goal under heavy pressure from Skarz, who had done well to get back into his own six yard box.
Good play down the centre from Collins, Rhodes Drinkwater in the 20th minute led to Pilkington receiving the ball in space down the Town left but as he ran at defender Taylor, he placed his attempted curler over the crossbar from the left corner of the penalty area.
Newcastle winger Geremi forced Alex Smithies into a fingertip save in the 23rd minute after he evaded his marker Joe Skarz at the back post to head a Guthrie corner towards goal, and from the second corner the former Chelsea man beat the defender to the ball again. Fortunately for Town, he powered his header over the crossbar.
Kevin Nolan had the ball in the back of Town's net on the stroke of 33 minutes after collecting a flick-on from striker Nile Ranger inside the area and neatly lobbing Alex Smithies, but the assistant referee immediately flagged for offside against the former Bolton midfielder.
GOAL - However, the home side did open the scoring in the 36th minute courtesy of a horrible error from Anthony Pilkington. The winger received the ball from Skarz on the left flank and tried to turn the ball inside to Kay, but instead picked out Danny Guthrie who advanced unchallenged to the edge of the area before placing his shot out of Smithies' reach and into the far corner.
GOAL - Within a minute, Lee Clark's side equalised through striker Theo Robinson. Newcastle defender Tamas Kadar was caught out by the speed at which Town played the ball forward and was knocked off the ball by the former Watford man, who advanced into the area before trickling the ball past the advancing goalkeeper and over the line.
Newcastle tried to hit back in the next minute when Nile Ranger found space in the area, but his snapshot was tipped wide by Alex Smithies before the recovering Skarz cleared the ball to safety.
GOAL - Amazingly, the Terriers took the lead in the 39th minute courtesy of Theo Robinson's second goal of the game. Another quickly played ball out of defence caught the Newcastle defence unaware, allowing Robinson to utilise his pace to latch onto the ball. The striker poked the ball past the onrushing Tim Krul before being tripped by the goalkeeper's trailing arm and the referee had no hesitation in pointing to the spot.
Among a tirade of boos from the home supporters, Robinson coolly stepped up and beat Krul to his left side from twelve yards to put Town ahead.
BOOKING - Goalkeeper Krul was booked for the challenge on Robinson in the lead-up to the goal.
A minute later Town could have extended their lead after Jordan Rhodes stumbled his way through the home defence, but his left-foot shot was tipped inches wide by the Newcastle custodian. From Danny Drinkwater's right-sided corner, Andy Butler powered a near post header well wide of goal.
BOOKING - Anthony Pilkington was booked for a cynical challenge on right-back Taylor soon afterwards.
Town had to play the two minutes of first half added time with ten men after Jordan Rhodes picked up a nasty head injury, but his teammates hung on to their lead as he received stitches to lead going into the interval.
HALF-TIME: NEWCASTLE UNITED 1 HUDDERSFIELD TOWN 2
SUB - Newcastle made a substitution during the interval, with Shola Ameobi replacing Nicky Butt; this saw the Toon switch to a tradition 4-4-2.
Lee Clark made no changes, as striker Rhodes was able to appear with his head heavily bandaged.
GOAL - Town scored in the 46th minute to extend their lead to two goals with a very well taken goal from Jordan Rhodes. The goal came out of the blue; Peltier tackled winger LuaLua on halfway and the ball ran to winger Drinkwater, who cleverly played the ball into the right side of the area. Rhodes stole in as the goalkeeper and a defender dithered and steered the ball around the stranded Krul before placing into the net from an acute angle.
GOAL - However, Newcastle were not finished and scored a good goal in the 48th minute to reduce the arrears. A smart one-two on the edge of the box between Ameobi and Nolan saw the latter feed the ball to Geremi inside the area and the midfielder placed the ball expertly into the corner of the goal, giving Smithies no chance.
A good interception in midfield from Antony Kay in the 53rd minute led to the former Tranmere man playing the ball into the feet of Jordan Rhodes on the edge of the area, who sent a shot wide of the far post with the outside of his right boot.
SUB - A clash of heads involving Geremi and Lee Peltier during a 56th minute corner led to the right-back being unable to continue and stretchered from the field of play; he was replaced by James Berrett at right-back.
Rhodes went close to his second of the game in the 61st minute, but his header from a Drinkwater corner drifted wide of Krul's right-hand post.
The home side were then awarded their own penalty in the 63rd minute after Andy Butler was deemed to have tripped Shola Ameobi. The gangly striker latched onto a through ball from midfielder Taylor before running towards Smithies' goal and as he crossed paths with the Town defender, their legs entangled and he fell to the floor just inside the penalty box.
BOOKING - Butler was booked for the indiscretion by referee Bates.
GOAL - Shola Ameobi stepped up to send Alex Smithies the wrong way, restoring parity in the scoreline.
SUB - Immediately following the goal Newcastle made their second substitution, with Jonas Gutierrez replacing LuaLua down the left wing.
Michael Collins sent a snapshot wide from 20 yards soon afterwards before substitute Gutierrez went on a mazy dribble into Town's penalty box a minute later, with Smithies doing well to turn his low shot around the post.
Ameobi found space inside the penalty box but fired wildly over the crossbar with twenty minutes left as the game became a little bit stretched.
Town were the next team to threaten when Pilkington played an excellent ball into the left channel for Robinson to chase. The dangerous striker turned inside before laying the ball to the edge of the box for Pilks, but he sent his left foot shot sailing into the crowd.
BOOKING - Joe Skarz was correctly booked by the referee in the 76th minute after he pulled back the lively Gutierrez.
The giant Ameobi then placed his back post header from another corner over the crossbar, having risen above Peter Clarke to meet the ball.
It took a brilliant last ditch block from Joe Skarz to deny Ameobi a second goal in the 80th minute after Gutierrez had again made space to cross.
SUB - Lionel Ainsworth replaced Danny Drinkwater on the right wing in the 80th minute in Town's second change of the evening.
BOOKING - James Berrett was booked in the 83rd minute after he hacked down Gutierrez from behind.
GOAL - From the resulting free-kick, Newcastle took the lead. Guthrie's delivery from the left wing was expertly knocked back across goal courtesy of the head of Ameobi, leaving Kevin Nolan with the simple task of knocking the ball into the unguarded net from two yards out.
SUB - Lee Clark made his final throw of the dice in the 88th minute, with Robbie Simpson replacing Jordan Rhodes.
A great sliding block from Peter Clarke denied Ameobi a certain goal in the six yard box as the game entered the four minutes of added time.
SUB - Newcastle handed Haris Vuckic a debut in the 90th minute; he replaced fellow sub Shola Ameobi.
A flurry of late corners for the Terriers saw goalkeeper Smithies reach the Newcastle penalty area, but Town couldn't find a way back into the game.
FULL-TIME: NEWCASTLE UNITED 4 HUDDERSFIELD TOWN 3
Town's Team (4-4-2):
Alex Smithies; Joe Skarz, Andy Butler, Peter Clarke (c), Lee Peltier (James Berrett 57); Anthony Pilkington, Michael Collins, Antony Kay, Danny Drinkwater (Lionel Ainsworth 80); Jordan Rhodes (Robbie Simpson 88), Theo Robinson
Unused Substitutes: Matt Glennon, Nathan Clarke, Robbie Williams, Lee Novak
Town Bookings: Anthony Pilkington (42), Andy Butler (63), Joe Skarz (76), James Berrett (83)
Newcastle Booking: Tim Krul (38)