Matthew Bates admitted Hartlepool United "made it hard" for themselves but was happy to see Pools see off a dogged York City.
Pools seemed set for a comfortable afternoon when Nathan Thomas put them ahead with his fifth goal since joining the club.
It looked even better for Pools when Dave Winfield was sent off for his second bookable offence 10 minutes from the break.
However, Thomas's 24th-minute opener was wiped out in the first seconds of first-half stoppage-time when defender Kyle Cameron headed in from a corner.
Pools had the better of play but were denied time and again by former Pools stopper Scott Flinders.
But Michael Woods headed in Carl Magnay's cross to give Pools a 72nd-minute winner.
"We made it hard for ourselves but that sometimews happens when you are playing against 10 men," said Bates.
"We scored the first goal and when they go down to 10 men you think 'happy days, it should be an easy afternoon' but York defended deep and made it hard for us.
"We conceded one from a set-piece which was disappointing but aside from yhat, I'm noyt sure Trev's had a save to make.
"We could may be have had three or four at the other end but that's football.
"We ground it out and got the three points."