Barnsley were forced to endure a nervy finish before bagging the three points which took them to second place in the table.
The home side had been dealt a double injury blow prior to kick-off, with Anthony Kay and Jacob Burns both ruled out, but they welcomed back Dutch ace Dean Gorre into their midfield.
Barnsley started brightly, with Lee Crooks carrying on his fine form from the weekend.
Yet it was Wrexham who thought they had drawn first blood in the 11th minute, striker Hector Sam converting from close range after a low cross from Jim Whitley, but fortunately for Barnsley the flag was up for offside.
After striker Isaiah Rankin had spurned a good chance in the 16th minute, Barnsley got their noses in front on 24 minutes.
They broke quickly following a Wrexham corner and Kevin Betsy delivered a terrific through pass that enabled Gorre to escape the attentions of central defender Brian Carey to beat Andy Dibble from close range for his fifth goal of the season.
Gorre then limped off with what appeared to be a twisted knee and Wrexham finished the half strongly and had loud appeals for a penalty waved away by referee Mark Cowburn.
Barnsley surged into a two-goal lead in the 64th minute thanks to the efforts of Steve Carson.
He delivered a wonderful left-wing cross, which saw a close-range header from sub striker Rory Fallon parried by Dibble, but the ball ran loose to Rankin who duly rammed home his third goal in four games.
Barnsley then appeared to sit back and invite Wrexham on to the attack and the Welsh side reduced the arrears on 73 minutes, sub Shaun Holmes netting with his first touch.
Barnsley then strung five men across the back and managed to see out the remaining minutes to secure a priceless victory.