Gray, who played with a protective strap on his left arm, scored City's only goal of the afternoon as a Bantams XI lost out to York City in a behind-closed-doors friendly at the Minstermen's training ground in Wiggington.
The City striker's goal came early into the second half when he headed home following a free-kick into the box from wide by Raffaele De Vita.
For Gray, the game was his first match of any sort since suffering a broken left forearm in City's maiden friendly of the summer against Guiseley.
Gray managed just under 75 minutes on his playing return, while De Vita completed the whole match.
Along with De Vita and Gray, fellow first-team members Alan Connell, who played 70 minutes, Carl McHugh and Connor Ripley all also featured.
The remainder of City's squad for the York fixture was made up of one trialist and nine apprentices.
Jason Kennedy, who was originally penciled in to play, was not risked due to an ankle injury picked up in training on Monday. Matt Taylor and Oliver McBurnie missed out as well because of knocks.
Fielding a strong side for the training ground fixture, York's team for the friendly included a large number of players who featured in their Sky Bet League 2 fixture against AFC Wimbledon last Saturday.