Gay added five rebounds and four assists and finished 10 for 20 shooting in a fine home debut for the Kings, who had lost eight of their past 10 games.
DeMarcus Cousins had 21 points and 10 rebounds and Isaiah Thomas added 19 points and eight assists to help Sacramento hold on to the lead for most of the final three quarters.
James Harden twisted his left ankle early in the third quarter but finished with 25 points and Dwight Howard had 13 points and 10 rebounds while battling foul trouble in a disappointing end to Houston's three-game road trip, following a loss at Portland on Thursday and a win at Golden State on Friday.
Damian Lillard hit a spinning fadeaway with one tenth of a second left in overtime to lift the Portland Trail Blazers to a 111-109 win over the Detroit Pistons.
The Minnesota Timberwolves hit a season-high 12 three-pointers and Kevin Love had 30 points and nine rebounds in the 101-93 win against the Memphis Grizzlies.
The Oklahoma City Thunder made it 12 straight home wins with a 101-98 defeat of the Orlando Magic, Kevin Durant contributing 28 points, nine rebounds and five assists.
The Denver Nuggets beat the New Orleans Pelicans 102-93 and the Phoenix Suns won 106-102 against the Golden State Warriors.