Josh Gillies beat Cameron Belford in the visitors' goal with a fine free-kick to put the Tynesiders ahead.
But Wrexham were back on level terms before half-time when Sean Newton produced an equally fine set-piece.
Ryan Bowman scored a fine winner for Gateshead, though, heading Craig Baxter's cross from the right across goal and into the net.
Gateshead manager Malcolm Crosby told BBC Newcastle: "To go and beat Wrexham tells me we have a decent side.
"We were disappointing in the first half but you have to give Wrexham credit because they played really well.
"In the first half, we didn't pass the ball well enough but in the second half, we did; that made the big difference.
"You come to watch football to see goals like our second one. It was a great bit of play, a wonderful cross and a great finish."
Wrexham manager Gary Mills told BBC Radio Wales Sport: "It was disappointing. We've had two or three games now when the second half has not been as good as the first.
"We were too open at times in the second half... having said that we've had some good chances and we haven't stuck it in the back of the net.
"They've not had a load of chances: a good free-kick for the first one and then obviously a good headers for the second one."
Match ends, Gateshead 2, Wrexham 1.
Second Half ends, Gateshead 2, Wrexham 1.
Corner,  Wrexham.
Attempt saved. Connor Jennings (Wrexham) left footed shot from a difficult angle on the left is saved.
Foul by Joel Logan (Wrexham).
James Marwood (Gateshead) wins a free kick.
Foul by Jimmy Phillips (Gateshead).
Adriano Moke (Wrexham) wins a free kick.
Corner,  Gateshead.
Offside, Wrexham. Connor Jennings tries a through ball, but Connor Jennings is caught offside.
Attempt saved. Josh Gillies (Gateshead) right footed shot from outside the box is saved.
Hand ball by Dominic Vose (Wrexham).
Attempt missed. Manny Smith (Wrexham) header from the centre of the box misses to the left. Assisted by Dominic Vose.
Corner,  Wrexham.
Attempt missed. Connor Jennings (Wrexham) header from the right side of the box misses to the right. Assisted by Sean Newton with a cross.
Foul by Josh Gillies (Gateshead).
Dominic Vose (Wrexham) wins a free kick.
Foul by Lee Fowler (Wrexham).
Jimmy Phillips (Gateshead) wins a free kick.
Foul by Connor Jennings (Wrexham).
Matty Pattison (Gateshead) wins a free kick.
Foul by James Marwood (Gateshead).
Joel Logan (Wrexham) wins a free kick.
Substitution, Wrexham. Joel Logan replaces Wes York.
Attempt missed. Ben Clark (Gateshead) header from a difficult angle on the left misses to the left. Assisted by Josh Gillies.
Corner,  Gateshead.
Foul by James Marwood (Gateshead).
Lee Fowler (Wrexham) wins a free kick.
Corner,  Wrexham.
Foul by Ryan Bowman (Gateshead).
Jamal Fyfield (Wrexham) wins a free kick.
Attempt missed. Connor Jennings (Wrexham) header from the centre of the box misses to the left. Assisted by Sean Newton with a cross.
Substitution, Wrexham. Lee Fowler replaces Rob Evans.
Foul by Sean Newton (Wrexham).
Josh Gillies (Gateshead) wins a free kick.
Attempt missed. Dominic Vose (Wrexham) right footed shot from outside the box misses to the right.
Corner,  Wrexham.
Attempt saved. Josh Gillies (Gateshead) left footed shot from outside the box is saved.
Substitution, Wrexham. Adam Smith replaces James Gray.
Goal!  Gateshead 2, Wrexham 1. Ryan Bowman (Gateshead) header from a difficult angle on the right to the bottom left corner. Assisted by Jamie Chandler with a cross.
Gateshead leapfrogged Wrexham into second place in the National League with a hard-fought win.