Ryan Jarvis's excellent individual goal moved Torquay five points clear of the League Two relegation places after beating York at Plainmoor.
Elliot Benyon opened the scoring when he reacted first from close range after Lee Mansell's corner was not cleared.
Jarvis then stole the show as he ran 50 yards before blasting in right-footed from 20 yards out.
Richard Cresswell's penalty set up a nervous finish after Tom Cruise was sent off for a foul on Josh Carson.
The loss leaves York deep in trouble at the bottom of League Two as they occupy the second relegation spot, one point clear of bottom side Aldershot.
VIEWS FROM THE DRESSING ROOM
Torquay United manager Alan Knill told BBC Radio Devon:
"It is all about the points; it was frantic at the end but it was great that we took them. It's been a great week for us.
"I didn't think we played great, but you do enough to win the game and that's all it's about. You don't want to know what I said at half-time, I wasn't happy about the performance"
"The referee had no choice about the red card, it was bad play by us."
"[It was] Fantastic again by the players, they just dug in to see out the game. What this week does, it just enhances the belief that we can compete with anybody in the league."
York City manager Nigel Worthington told BBC Radio York:
"The game is 90 minutes long, it's not 20, and you cannot give the opposition a two-goal start because its tough going getting back into it, but I think they showed a lot of spirit.
"They passed the ball a lot better today than what we have done, which I was very pleased with, but we need more conviction around the opposition's goal.
"I probably think that maybe a little of the self-belief and the confidence is being jolted a little, so it's just about being brave and taking the responsibility on and making it happen."