SACRAMENTO, Calif. -- Toronto Raptors coach Dwayne Casey wanted another explanation and wasn't about to accept easily the ending he just saw.

Sacramento Kings forward DeMarcus Cousins couldn't believe it, either, but he wasn't about to question it.

"I knew I tipped the ball. I knew that the timer hadn't started (immediately)," Cousins said. "I also knew that (we) were going to overtime."

Only, they didn't. In an ending that neither team could quite believe, the Kings held on for a 102-99 win over the Toronto Raptors at Golden 1 Center, when refs ruled that Toronto's Terrence Ross could not have released a last-ditch 30-foot 3-pointer before the final buzzer.

It sure didn't look that way. Ross' fling swished through with three-tenths of a second showing on the stadium scoreboard clock, and the Raptors and Kings prepared to play an extra five minutes. But after a lengthy replay review, referee Mike Callahan ruled that the clock should've started about a half-second faster than it did and waved off the game-tying shot.

"We don't ever get these breaks," Kings forward Rudy Gay said. "So, it's really surprising."

Gay finished with 23 points, the final four on a pair of dunks off turnovers, and the Kings (5-9) snapped a four-game losing streak by winning for the fourth straight time over Toronto.

Gay's second dunk, off a 3-on-1 break, came after a steal by teammate Darren Collison and followed Collison's three-point break on a layup and foul with 3:14 left that broke a 97-97 tie. Both sequences put Sacramento ahead 102-97. Toronto guard Kyle Lowry then made two free throw, and after the Kings committed a 24-second violation, Toronto received one more chance on an inbounds play from near the Kings bench with 2.4 seconds left.

Cousins tipped the inbounds pass, Ross picked it up, took a dribble and fired with 0.5 second showing.

"I knew I had at least two seconds," Ross said. "I knew I could take a dribble and still get it off. I don't know how a tipped ball can amount for a five- or six-tenths of a second. ... Nothing can justify it. It's just a bad call."

Casey said the Raptors (8-5) would look into the call with the league but didn't know if the Raptors had any real options other than to swallow the difficult outcome.

"I've got to hear another explanation, because we reviewed it about 10 times in there. Even if the clock started once DeMarcus Cousins deflected it, T. Ross caught it, shot it with plenty of time. ... I've got to hear more, because I just watched the review that they had it."

According to Casey, referee Courtney Kirkland started the official clock and that it didn't match the stadium clock.

Jonas Valanciunas and Kyle Lowry each scored 23 points for the Raptors, but Lowry missed the last of three free-throw attempts with 26.2 seconds left to keep Toronto down 102-99. Valanciunas added 14 rebounds.

Sacramento held DeMar DeRozan, the NBA's leading scorer, to a season-worst 12 points. DeRozan's previous low was a 23-point effort against the Kings on Nov. 6.

Cousins finished with 19 points and 10 rebounds for Sacramento and made three of the Kings' season-high 11 3-pointers.

Sacramento coach Dave Joerger shook up his starting lineup, sitting guard Aaron Afflalo and forward Kosta Koufos and starting Matt Barnes and Collison in a bid to go smaller and quicker. Collison finished with 15 points, nine assists and two key steals in 32 minutes, while Barnes added eight points.

Afflalo had 14 points and five rebounds in 20 minutes off the bench, and Koufos grabbed six rebounds to go with his eight points.

Koufos and Garrett Temple also saw key minutes down the stretch, as Joerger stayed small.

Valanciunas, who did not dress in Toronto's 96-91 loss to the Kings on Nov. 6, reached the 20-point plateau for the first time since a season-best 32-point night against Detroit on opening night. He went 9-for-17 from the field and took advantage of Cousins' second-period absence to score 19 in the first half. Cousins played only 20 seconds in the second quarter because of foul trouble.

The Raptors (8-5) were playing for the first time inside the Kings' new arena and led 92-89 after scoring eight consecutive points early in the fourth quarter. But Sacramento scored 13 of the next 18.

NOTES: Kings coach Dave Joerger trotted out his fourth starting lineup in the Kings' first 14 games. A year ago, under coach George Karl, Sacramento featured 11 starting lineups in its first 14 contests. ... The Raptors play for the seventh time in 11 days and complete their third set of back-to-back contests when they face the Clippers on Monday in Los Angeles. They swept one set at Charlotte and against New York and were swept at Cleveland and at home against Golden State. ... Kings C DeMarcus Cousins played his 429th game, tying him with Duane Causewell for ninth on Sacramento's all-time list. He is 112 shy of all-time leader Jason Thompson. ... The Raptors lead the Atlantic Division despite entering Sunday's contest 24th among the NBA's 30 teams in defensive rebounding and ranking 17th in overall rebounding. ... One difference between the two teams during the first three weeks: Toronto was recovering 5.3 loose balls per game, the best mark in the NBA, and the Kings were recovering 2.9, tied for the league's second-worst mark.