Another 3 by Dudley tied it at 72 with 2:10 to go, and Shannon Brown, who made just one of his first seven shots, scored on a fast-break layup to put Phoenix ahead 74-72 with 1:23 left in the quarter.
It was knotted at 76 entering the fourth.
Dudley was fouled by Copeland on a 3-point try and made all three free throws to put Phoenix up 90-86 with 5:19 left, but Smith scored the next four, Kidd sank a 3 and Copeland made a 21-footer in a 9-0 spurt that had the Knicks up 95-90 with 3:34 left.
After a scoreless 1:28, Sebastian Telfair made a 3, then Brown sank a 20-footer to tie it at 95 with 1:15 remaining.
Smith missed a jumper from the top of the key 52 seconds from the finish and the Suns got the ball. Dudley was fouled on a drive to the hoop and made both free throws to make it 97-95.
But Smith, with P.J. Tucker all over him, sank a fadeaway from just outside the free throw line to tie.
Gentry called a 20-second timeout but the play broke down and, when Telfair tried to hit Gortat for a back-door layup, the ball was knocked back into the backcourt by Kidd. Telfair chased it down but wound up stepping out of bounds with a second on the clock.
After a timeout, Kidd tossed the pass to Smith, who got the shot off, again over Tucker, from just inside the 3-point line. It went in and he was mobbed by his teammates.
"It happened so fast and obviously you want to keep it for the last shot and live with that," Dudley said, "but you give them one second and J.R. with the big shot."
NOTES: The Knicks complete their three-game trip west at Sacramento on Friday. ... New York has lost two in a row only once this season. ... Michael Beasley, a big part of the second-half surge, missed Sunday's home loss to the Clippers due to illness. ... The 36 points were the most by a Suns player in two seasons. ... Kidd also had eight assists and six rebounds. ... New York also was without Rasheed Wallace with a sore left foot. .... It was the first time the team had been without Anthony and Felton in the same game. .... The Knicks are 3-2 without Anthony.
Follow Bob Baum at www.twitter.com/Thebaumerphx