Lincoln City face an uphill task to reach the play-off final at Cardiff after crashing to their third defeat in a row.
The out-of-form Red Imps looked distinctly second-best for much of the game against a Huddersfield team determined to make up for the disappointment of missing automatic promotion.
Town went in front after just five minutes when the Lincoln defence was caught out at a set-piece move.
Rob Edwards floated over a corner from the right which veteran Iffy Onuora flicked home at the near post.
When Lincoln tried to hit back, a superb pass from Richard Butcher put Marcus Richardson clear but Town keeper Paul Rachubka was quickly off his line to save at the Lincoln striker's feet.
Richardson missed another chance but Huddersfield were quick to get back on top and Onuora had the ball in the net again two minutes before the half-time break only for his effort to be disallowed for offside.
Lincoln stormed back early in the second half and drew level in the 51st minute.
Kevin Ellison sent over a cross from the left that Simon Yeo met with his head. Rachubka saved and then blocked the follow-up from Ben Futcher but Gary Fletcher followed up to net from close range.
Lincoln had the chance to go in front in the 69th minute when Yeo easily beat Efe Sodje before firing in a low cross. Richardson moved in for the kill but the ball skidded under his boot and he failed to get in a shot.
The winner came 18 minutes from time after Lincoln keeper Alan Marriott brought off a great save from an Andy Booth header.
Mark Bailey tried to complete the clearance but simply sent the ball straight against the legs of David Mirfin and the ball flew back into the net.
Lincoln boss Keith Alexander said afterwards: "We had some good chances but we didn't take them. I was disappointed with both goals that we conceded." Town manager Peter Jackson said: "We had a perfect start but it's only half-time. Lincoln will fight for everything on Wednesday. It's a big, big game."