Gray initially joined the Minstermen on a month`s loan from Torquay United in October before completing a permanent transfer until the end of the season.
The 25-year-old forward began his career at Darlington having come through the youth system at Middlesbrough.
After a short spell at Kettering Town, he joined SkyBet League Two side Accrington Stanley in August 2012 on a one-year deal.
After almost three years at the Crown Ground, including a loan spell at Northampton Town, the Yarm-born striker then had spells at Wrexham, Southport and Glenavon before joining Torquay in July 2017.
Gray has caps for Northern Ireland at youth levels from under-16 to under-21.