Jon Shaw hit a hat-trick to see off York and send Gateshead top of the Blue Square Bet Premier table.
Shaw opened the scoring, stooping to head in Josh Gillies' cross before Jason Walker levelled, clipping home Patrick McLaughlin's pass.
Shaw headed in after a sweeping team move and completed his second successive treble from the spot after Jon Challinor fouled Yemi Odubade.
James Curtis put Adriano Moke's corner into his own net but Gateshead held on.
VIEWS FROM THE DRESSING ROOM
York City manager Gary Mills told BBC Radio York:
"I thought my players were excellent tonight.
"Yes, we gave away silly goals, we know that, but I think what we've done over the last three weeks has been superb.
"We're not dropping our heads by any means. We've come here against a team sitting at the top and they're a good side. So are we. We scored two goals away from home and that's disappointing."