The Clarets had gone ahead just before the half-hour mark when Jay Rodriguez converted Ashley Westwood's peach of a pass.
That was, however, as fruitful as it got for the Clarets, who had led against their Championship opposition at the break.
The Terriers drew level with just over a quarter-of-an-hour remaining when Matt Lowton was robbed of possession on the halfway line and Sorba Thomas crossed for Josh Koroma to convert from close range.
The visitors then turned the tie on its head in the 87th minute when substitute Thomas was once again the provider as defender Matty Pearson powered a header home from his corner.
James Tarkowski almost forced extra-time in the closing stages, but the centre back failed to keep his header on target when unmarked from Westwood's set-piece.
Here are the ratings.

9. Dale Stephens 4.5
Showed some neat touches to ease the pressure on the edge of his own box in the first half, and always looking to play a forward pass, but lacked composure on the ball after the break and was bypassed in midfield as Town started to dominate possession.

10. Jay Rodriguez 6
The striker was a handful in the first half, picking up space in-between Town's three centre backs and causing a threat. Had several chances before his opener, which he took extremely well, but his influence waned in the second half when employed as a lone wolf.

11. Chris Wood 4.5
Without a goal in five games heading into the tie and showed no signs of altering that run against the Terriers. Hogg and Russell had the striker tied up when the ball was played out from the back and Town's back three kept the Kiwi quiet in the final third. Subbed at the break.

12. Jack Cork 4
Utilised in a number of unfamiliar positions after replacing Wood at the break. Looked lost when supporting Rodriguez as a 'number 10' and didn't feature when moved out to the right, with Town capitalising on the space and using Koroma as their out-ball.

