Midfielder Harry Pell netted 11 minutes from time as the hosts climbed from bottom to 21st in the table and also ensured Nigel Worthington's reign as Minstermen boss got off to a losing start.
Chris Smith had earlier twice clawed York back, equalising shortly after Mat Mitchel-King's strike in the 21st minute and Brennan Dickenson's on the hour, but it was not to be.
The Dons are now two points above the drop zone, however boss Ardley is not getting carried away with the implications of the result and is determined to keep everyone's emotions in check.
"We tried to stay calm and when they pegged us back twice, we kept the information from the bench positive and fair play to the boys because they showed great character," he said. "Obviously you worry that it's another decent home performance where we're the better team and haven't come away with a win.
"We were the better team throughout the game and we deserved the win but when you're down where we are you can get nervous and give away silly little fouls that cause problems. But I've got a bunch of players who are giving absolutely everything and care what happens. I can't ask for more than that.
"If you look at the magnitude of the situation a home win is absolutely vital and we had to stay calm. We were in control of our performance; we're not going to worry about other teams. The win is great for the fans but I haven't looked at the table. We need four more wins, that's what I keep saying."
York boss Worthington, appointed on Monday, is adamant the Minstermen can avoid the drop themselves despite now sitting just two places and a point ahead of the Dons.
"This is a learning curve and a lot of things we need to learn very quickly. There's one or two things we've got to continue to work on and improve on," Worthington said. "These next nine games are all about mental toughness, individually and collectively, and the situation stares us in the face. It's how you deal with it that counts. You can fight it or buckle.
"I would like to think there's enough in there to get the points required. There's no sympathy in the game and we know that. The spirit is very good, they're together and I'm very pleased with that. It's just mistakes cost goals and there's some little mistakes we have to tidy up on."
- Sports & Recreation
- Nigel Worthington