Carlisle slumped to their third successive League defeat as Wrexham plundered the points with a goal three minutes from time from substitute Hector Sam.
The result delighted Red Dragons boss, Denis Smith, who said: "It was an excellent win. I took a gamble to play three up front and it paid off with the winner.
"I felt we needed three points so it was a gamble worth taking.
"It's great when it comes off but you look an idiot when it doesn't.
"In the end I thought we just about deserved the win, although we didn't play as well as we did in midweek." The victory avenged Wrexham's defeat last Tuesday in the LDV Vans Trophy but the Welshmen had to recover from an early Carlisle strike.
Richie Foran grabbed the opener for Carlisle in the fifth minute after debutant Mark Hudson picked him out in the box and the Irishman kept his cool to finish from 12 yards.
It was a different story in the 90th minute when red mist descended on Foran and he was shown a straight red card for a foul on Paul Barrett.
The dismissal will be a blow to Carlisle in games to come but it did not really matter by then as United had already conceded two sloppy goals.
Lee Jones got the first when he robbed Des Byrne to fire a deflected shot past Matty Glennon from 25 yards and with time running out Brian Shelley lost possession in the middle of his own half and Jones sent Sam through to net the winner.
Carlisle coach Tony Elliott said: "We need to be a bit more professional. Not being professional has cost us two goals today. We had the lead and we have to learn to shut up shop."