The Spartans (2-3, 1-1 Mountain West) trailed 7-0 in the first quarter, but then pulled away with 33 straight points.
Gray's rushing touchdown tied it a 7, Austin Lopez kicked four field goals, and Tyler Ervin broke away for an 83-yard rushing score. Gray's 51-yard strike to Hansell Wilson made it 33-7 early in the fourth quarter.
Ervin finished with 133 yards on 11 carries. Jabari Carr had 51 yards on five receptions.
The Rebels were held to 221 total yards and committed two turnovers. Keith Whitely led UNLV with 79 yards rushing.