The Skrill Premier side fell behind to Tommy Rowe's first half goal but Peterborough lad Michael Gash headed in a leveller.
Jack Byrne fired Harriers ahead four minutes later but Britt Assombalonga levelled from the penalty spot for The Posh.
But Joe Lolley's stunning 25-hard strike barely two minutes later sealed a pulsating tie and ensured Harriers will play Premier League Sunderland at the Stadium of Light on Saturday, January 25.
"I couldn't be more proud of the players," said Thorn, who won the cup with Wimbledom I'm 1988.
"The way they have responded and are working for us.
"The fans were fantastic but the players deserve an unbelievable amount of credit.
"It's been a competition I have been lucky in, although I didn't think we were lucky tonight."
Lolley looks set to sign for Huddersfield Town this week for a fee believed to be in the region of £250,000.
"It was a fantastic strike and it is the type of thing he can do,"added Harriers' manager.
"He needed to do it because he gave the ball away for the penalty and if he had been near me, he might not have been on the pitch! "He's an immense talent and the club has been good for him and he's been very good for the club.
"It's the worst kept secret in the world and he will be moving on.
"He's been fantastic for us but we've got our ducks in a row.
"We've had to make sure things are right because when Joe does eventually go the club will still be there.
"We need to have the right help and bring some players in."