NEW YORK (AP) -- Rudy Gay made the tying basket in regulation and a 3-pointer in overtime that gave Sacramento the lead for good, and Jimmer Fredette scored a career-high 24 points to help the Kings beat the New York Knicks 106-101 on Wednesday night.
Gay finished with 20 points for the Kings, who shook off a 13-point deficit and the loss of DeMarcus Cousins late in regulation to salvage the finale of a four-game road trip. Cousins had 19 points and 14 rebounds before limping off with about 3½ minutes left.
Carmelo Anthony had 36 points and 11 rebounds for the Knicks but flopped at the finish, missing a potential winning shot in regulation before blowing a layup on the first possession of overtime. He was scoreless in the extra session.
Gay followed Anthony's missed layup with his 3-pointer, Derrick Williams added a basket that pushed it to 98-93 with 2:28 left, and the Knicks never really had a chance to catch up from there.
New York finished a disappointing and turbulent first half at 20-32. The reigning Atlantic Division champions have already lost more games than all of last season and continue to battle injuries and speculation that coach Mike Woodson's job is in jeopardy.
The Knicks played without J.R. Smith, who broke a cheekbone Sunday at Oklahoma City and was uncomfortable with the protective facemask he was supposed to wear, which he didn't receive until Wednesday. Iman Shumpert then left in the second half with a strained left hip flexor.
Amare Stoudemire scored 20 points off the bench and Tyson Chandler had 17 points and 11 rebounds for the Knicks.
Stoudemire had three straight New York baskets midway through the fourth quarter, giving the Knicks an 87-83 advantage with 4:59 remaining. Fredette twice hit 3-pointers to make it a one-possession game, and Gay, after having a jumper go in and out, got another chance and knocked it down that time to tie it with 20 seconds to go.
Anthony scored 17 points on 7-of-9 shooting as the Knicks cruised to a 33-22 lead after one, hitting 70 percent of their shots. But Fredette, the college scoring star from BYU whose pro career has been largely underwhelming, answered back with 15 points in the second, matching his high for a game this season. The Kings scored easily for most of the period, going ahead 46-41 when Fredette kicked it out to a wide-open Gay in the corner.
New York surged back ahead for a 54-48 halftime lead on 57.5 percent shooting, but was just 7 of 23 (30 percent) in the third quarter, with the Kings cutting it to 74-72 entering the fourth.
NOTES: Smith didn't want to play without the mask for fear of further injury, acknowledging his choice to sit out was a "somewhat selfish decision." He says he will have to wear the mask for a few weeks and hopes to get it adjusted before play resumes next week. ... Kings coach Michael Malone said he had family in the crowd for his first game as a head coach at Madison Square Garden. He was a Knicks assistant from 2001-2005, working for four different head coaches in four years. ... The Knicks honored Hall of Famer Bernard King, who held the franchise's single-game scoring record with 60 points until Anthony broke it with 62 last month against Charlotte.