McGrath, club captain at Albion, has been unable to force his way back into the Brewers' starting line-up following a five-month absence with a foot injury.
The 32-year-old will remain with the Minstermen until March 11 and is reunited with manager Gary Mills, who he played under at Tamworth.
Despite being allowed to leave the Pirelli Stadium, Burton boss Gary Rowett insists McGrath remains part of his plans as the team chase promotion from League Two.
He said: "I've done this reluctantly, in a way, because characters like Macca are the sort of people I want around the club.
"I had hoped that I would be able to find him a place back in the side before now but, since he had that bad injury, the form of Lee Bell and Robbie Weir in the middle has been too good to disrupt.
"I know John is desperate to play and, with him going to York, he will now have a month of League Two football.
"I hope that means that we will get an even more match-fit Macca coming back to us later in the season."