SACRAMENTO, Calif. -- When he first heard the referee's whistle, Sacramento Kings forward Rudy Gay looked up and saw Toronto Raptors guard Kyle Lowry's 3-point jumper fall through the net. Like most in attendance at the Sleep Train Arena, Gay immediately thought Lowry would be trying to sink a free throw for a four-point play.

Instead, the officials called Lowry for kicking out his legs on the shot, an offensive foul that essentially sealed Sacramento's 109-101 victory Wednesday and killed Toronto's bid for a stunning comeback.

"I honestly did think (the foul) was on us, but I wasn't shocked when it went the other way," Gay said. "You can never be shocked in basketball. ... It was nice to see one of those go our way."

Gay, center DeMarcus Cousins and guard Isaiah Thomas made sure the contest against many of their old teammates went Sacramento's way by combining for 72 points. In addition, Gay, Cousins and forward Jason Thompson grabbed 10 rebounds apiece, and the Kings won their second straight following a seven-game skid.

"We made it interesting," Kings coach Michael Malone said. "We always find a way to make it interesting. That's all I'll say."

Sacramento led 96-74 after Cousins sank two free throws with 9:37 left in the fourth quarter, but Toronto forward Steve Novak made two consecutive 3-pointers to start a 19-2 run over a 6 1/2-minute stretch. Toronto trailed 105-99 with 28 seconds left when Lowry's apparent 3-pointer over Sacramento guard Ben McLemore was nullified.

Lowry, incredulous with the call, picked up his second technical foul of the contest, and Thomas made the ensuing two free throws to cap a 23-point effort.

"I have to watch it again on replay," Raptors coach Dwane Casey said. "But again, you don't let one call decide the game."

Cousins, often matched against forward Patrick Patterson and forward Chuck Hayes, his former teammates, finished with 25 points, and Gay had 24 against his former team in the first meeting since a seven-player trade between the clubs on Dec. 9.

"It did make it tougher," Cousins said of facing his old teammates. "Especially with guys like Chuck Hayes and Patrick Patterson. That did make it tough."

Guard Marcus Thornton added 12 points for the Kings (17-32) before leaving the contest for good late in the first half. Thornton suffered a bruised right hip and left knee after falling hard while going for a rebound. His status will be evaluated before the Kings open a four-game road trip against the Celtics in Boston on Friday.

Lowry finished with 21 points to lead Toronto (26-23). Raptors guard DeMar DeRozan finished with 18 but made just five of 17 shots. DeRozan averaged 26.8 points in Toronto's previous eight road games.

Patterson scored 14 points for the Raptors, who had been thriving since he arrived in the deal that sent Gay, guard Quincy Acy and center Aaron Gray to Sacramento. Hayes, guard Greivis Vasquez and forward John Salmons, the other three players obtained from the Kings, combined for 10 points, and Vasquez fouled out of the contest late in the fourth quarter.

Toronto fell to 19-11 since the trade. The loss was only its second double-digit defeat in that period.

The Kings, who set a Sacramento-era record by holding the Bulls to 28.2 percent shooting in a 99-70 win Monday, appeared to be cruising until Novak, a career 43 percent shooter from 3-point range, got loose and nailed three 3s on consecutive fourth-quarter possessions to start Toronto's run.

"Obviously, Steve Novak is probably one of the best 3-point shooters in history," Gay said. "He got open time and time again, and that had a lot do with (their rally). ... Luckily we had that cushion."

The Kings are the only team in the NBA with three players averaging 20 points per contest. The victory marked the sixth time all three scored 20 points in the same contest.

NOTES: New NBA commissioner Adam Silver attended the game along with deputy commissioner Mark Tatum. Silver, who replaced David Stern last Friday after the final day of the former commissioner's 30-year tenure, was unable to tour the Downtown Plaza, the sight of the Kings' proposed new arena, because of bad weather that kept him from arriving on time. Silver said he likely will visit the area Thursday. "I'm not going to leave without seeing the Downtown Plaza," he said. ... Kings G Marcus Thornton left the game after landing on his face and elbow while going for a rebound late in the first half. He did not return. ... Toronto G Kyle Lowry was in the lineup after leaving Monday's contest with pain in his right knee. ... Of the seven players traded in the blockbuster December deal between the two teams, Kings F Rudy Gay is the only one who is starting.