Gay had nine points in the fourth quarter as the Kings (3-5) snapped a four-game losing streak by winning the finale of their five-game road trip.
Valanciunas’ injury and Poeltl’s foul trouble meant Lucas Nogueira, seeing his first action of the season, had to pick up the slack. He had seven points and five rebounds in 21 minutes.
The teams swapped leads throughout the fourth quarter until Cousins’ layup with 2:55 to go gave the Kings a 90-88 advantage. They led the rest of the way.
After DeRozan missed a pair of free throws that would have tied it, Gay hit two from the stripe at the other end to give the Kings a 92-88 lead with 1:54 remaining.
Lowry’s steal and three-point play put Toronto up 73-72 with 9:34 to go. But 3-pointers by Gay on consecutive trips staked the Kings to an 87-83 lead with 4:41 left.
Lowry’s 3 and DeRozan’s basket gave Toronto a short-lived 88-87 lead.
Sacramento led 68-66 going into the fourth quarter. The Kings, who trailed by 11 points midway through the third, closed the period on a 7-2 run to take their first lead since early in the first.
The Raptors led 50-44 at halftime. DeRozan led all scorers in the first half with 12 points, while Cousins had 10. Each team shot 42 percent from the field.
Toronto led 23-20 after the first quarter. The Raptors opened a 10-point lead before the Kings closed the quarter on an 11-4 run over the final 2:40.
Kings: Cousins had his 247th double-double, most in Sacramento history. . The Kings dominated in the paint, outscoring the Raptors 52-30.
Raptors: Valanciunas was a late scratch. He bruised his left knee last week and it swelled up before the game. He is day to day. . Toronto rookie Pascal Siakim set season highs for minutes (24) and points (10). . The Raptors scored 13 points off 11 Kings turnovers, while Sacramento had two points off six Toronto turnovers.
Kings: Host the New Orleans Pelicans on Tuesday, starting a stretch with seven of their next eight games at the new Golden 1 Center. Sacramento is 1-1 at home this season.
Raptors: Visit the Oklahoma City Thunder on Wednesday for their second road game of the season. Toronto went a franchise-best 24-17 on the road last season.