Striker Jordan Burrow scored the opener on 53 minutes before Danny Johnson's stoppage-time goal secured a victory which saw Gateshead move up to fifth.
Wrexham's defeat came after two successive away wins and was only their second loss in 10 games.
Dean Keates' side remain 10th and are nine points off the play-offs.
Neither side were able to break the deadlock during the opening 45 minutes with Wrexham's Ollie Shenton coming closest when he fired over the bar from Izale McLeod's cross.
Shenton's powerful volley was blocked by keeper Jamie Montgomery early in the second half before Gateshead took the lead.
Burrow beat Chris Dunn from 10 yards to score his fifth goal for Gateshead since joining from Halifax in November.
Wrexham substitute George Harry was denied a late equaliser by former Dragons defender Manny Smith.
Halifax sealed the win to extend their impressive form in the fourth minute of stoppage time with Johnson netting his seventh goal in six games from close range after receiving the ball from Tom Beere.
Wrexham manager Dean Keates said: "Overall it wasn't that bad a performance. Obviously it was disappointing.
"I think for long periods of the game we were in control and looked more capable but weren't clinical around their box.
"In the first half we edged it and in the second half, even when they scored, we were getting on top. I don't think it's a 2-0 game. We hope to get a reaction next week at Forest Green."
Match ends, Wrexham 0, Gateshead 2.
Second Half ends, Wrexham 0, Gateshead 2.
Goal!  Wrexham 0, Gateshead 2. Danny Johnson (Gateshead).
Substitution, Wrexham. George Harry replaces Izale McLeod.
Substitution, Gateshead. Mitch Brundle replaces Jamal Fyfield.
Substitution, Wrexham. Jordan White replaces Paul Rutherford.
Substitution, Wrexham. Leo Smith replaces Oliver Shenton.
Substitution, Gateshead. Tom Beere replaces George Smith.
Goal!  Wrexham 0, Gateshead 1. Jordan Burrow (Gateshead).
Second Half begins Wrexham 0, Gateshead 0.
First Half ends, Wrexham 0, Gateshead 0.
First Half begins.
Lineups are announced and players are warming up.
Gateshead moved into the play-off places by securing a sixth successive National League win with victory at Wrexham.