SACRAMENTO, Calif. (AP) -- James Johnson picked quite a dramatic moment to make his first 3-pointer of the season.
Johnson had missed his first 11 3s this season, but his 12th attempt won the game at the buzzer on Friday night, lifting the Kings to a 106-105 victory over the New York Knicks after blowing an early 27-point lead.
With time running out, John Salmons was trapped in the corner and found Johnson above the top of the key. Johnson's shot left his had just ahead of the final buzzer. The shot helped the Kings avoid a collapse after building a big lead in the first half.
''Isaiah (Thomas) hit John, but he couldn't take the shot, he was crowded,'' explained Johnson, who had a season-high 17 points that included seven in the fourth. ''He looked at Francisco (Garcia) as his first option and I was his second read. There was no thinking after that - I had to shoot it. I knew it was good as soon as it left my hand.''
Johnson was a starting forward when the season began, but his erratic outside shooting relegated him to the bench. However, he has worked before and after practice to gain confidence in his shot and it's showed of late. He's made 49 percent over the last six games and is average 8.7 points.
Johnson, who came to the Kings in an offseason trade with Toronto, converted 8 of 14 shots against the Knicks, most of them on drives to the basket.
''It was a broken play and we made something out of it,'' said Thomas of the game's hectic final 16 seconds. ''J.J. made a huge shot. We knew it was his first (3). I've been clowning with him about it. I knew he hadn't made one yet.''
Marcus Thornton scored 18 points and Cousins had 15 points and 10 rebounds for the Kings, who led by 21 points at intermission. Jimmer Fredette also had 15 points and Thomas had 11 points and nine assists for Sacramento, which made a season-high 15 of 30 3-pointers.
''We gambled a bit when the ball came out of the deep corner for the steal,'' Knicks coach Mike Woodson said. ''But we came up empty and Johnson was able to get a free catch and shoot it.''
The Knicks played their second straight game without an injured Carmelo Anthony, who leads all Eastern Conference scorers, averaging 28.5 points per game. Anthony has a hyperextended left knee and his hoping to return Jan. 1 when the Knicks play Portland at home.
J.R. Smith scored a season-high 28 points for the Knicks, who outplayed the Kings throughout most of the second half. Rookie Chris Copeland had 23 points and Tyson Chandler had 21 points and 18 rebounds.
Knicks point guard Jason Kidd had 16 points, five assists and seven rebounds. But he also committed a turnover on New York's final possession.
''We got stagnant out there in the second half,'' Kings coach Keith Smart said. ''We played great early on, but the game changed quickly in the second half.''
After Garcia cut the Knicks lead to a point, Chandler made a free throw and Copeland hit a jumper to put New York ahead 105-101 with 2:51 left. Two free throws by Thomas pulled the Kings to 105-103 with 33 seconds remaining.
With a chance to pad its two-point lead, New York had a costly turnover instead. Kidd's lob pass inside to Chandler was picked off by an alert Cousins, who made a quick outlet pass to Thomas.
''I had Tyson wide open, it was an easy pass but I just turned it over and they came back and capitalized on it,'' Kidd said.
New York was also without starting point guard Raymond Felton, who has a broken left pinkie finger and is expected to miss at least a month.
Cousins was back in the starting lineup after missing the previous two games after Sacramento suspended him for unprofessional behavior and conduct detrimental to the team after a verbal confrontation with Smart during a game Dec. 21 against the Clippers.
''I wanted to get this thing behind us, get it over and move on,'' said Smart, explaining his decision to put Cousins back in the starting lineup. ''He was rusty, yes. But he made some big plays down the stretch.''
Chandler dunked on an alley-oop pass from Kidd midway through the third quarter. The next time down the court, Kidd stepped back for a 3-pointer, giving the Knicks a 97-95 lead, their first lead since the opening minutes.
Smith scored 11 points in the third quarter when the Knicks used a hustling defensive effort to outscore the Kings 31-16 and pull to 87-81 heading into the fourth.
Following a lethargic first half, the Knicks showed much more energy in cutting into Sacramento's 21-point halftime lead. Back-to-back three-point plays by Smith and Chandler trimmed the Kings lead to 85-77 with 2:17 left in the third.
Thornton scored 11 first-quarter points to help the Kings take an 11-point lead into the second. Fredette took over the offensive load in the second quarter, making three 3-pointers and scoring 15 points, helping the Kings to a 71-50 lead at the half.
''We buried ourselves in the first two quarters, then we decided to defend in the third and fourth quarter,'' Woodson said. ''We got back in it and had control at the end. They made a great shot.''
Copeland and Smith had 13 points in the first half for the Knicks, who trailed 68-41 late in the second quarter.
The Knicks poor perimeter defense in the opening half cost them repeatedly with the Kings making 10-of-15 attempts and producing a season high for points in one half. Sacramento shot nearly 60 percent overall and had 19 assists, another season-high for a half.
NOTES: In the first quarter, the Kings connected on four straight 3s in four possessions, building their lead to 26-14. ... Woodson was a starting guard for the inaugural Sacramento team that relocated from Kansas City for the 1985-86 season. ... Kings starting guard Tyreke Evans has missed six straight games and 11 of the last 15 due to an injured left knee. He may try to play Sunday against Boston. ... Knicks reserve forward Rasheed Wallace was out with a sore left foot. ... The Knicks are hoping injured forward Amar'e Stoudemire will return sometime next week. A knee injury has kept Stoudemire inactive all season.