City could easily have been three goals down by half-time, but Danny Cadamarteri seemed to have won it for the visitors, when he fired them into an 83rd minute lead, despite Jorgensen and Ashley Ward looking suspiciously off-side.
But Wrexham came back fighting to win it with two goals in the last two minutes.
First,a Darren Ferguson free kick was blocked by Mark Bower, but the ball dropped for Andy Morell to lash it past a helpless Aidan Davidson and the match looked set for extra-time.
Then in the last minute Carlos Edwards picked up a pass from sub Shaun Holmes and grabbed the winner.
It was bitterly disappointing for City boss Nicky Law who said: "We were appalling, and I won't accept performances like this. I shall make a couple of changes for Saturday.
"I knew this would be a potential banana skin but Wrexham are an average third division side."
Wrexham manager Dennis Smith was smiling after his side got through to the second round of the competition for the first time in eight years. He said "It was an excellent performance and we got the result we deserved.
"It was a great team display and a good all round effort from the lads. We are not exactly rolling in cash so Man United would do nicely in the next round."