Larry Hughes had 22 points, including three free throws with 10 seconds left to send the game into overtime for the Knicks, who have won two in a row.
David Lee chipped in 16 points and 18 rebounds in the win, while Wilson Chandler scored 17.
Antonio McDyess registered a career-high 22 boards to go with his 21 points for the Pistons, who have dropped two of three on the heels of a four-game winning streak. Tayshaun Prince ended with 25 points and 10 rebounds in the setback. Rodney Stuckey had 23 points, eight boards and as many helpers.
Richard Hamilton dropped 27 points and grabbed nine boards, but committed the costly foul on Hughes late in the game that essentially sent the game to OT.
McDyess scored the first basket of overtime, but Chandler and Hughes responded with baskets to give the visitors the lead, 105-103, about 1 1/2 minutes in.
Trailing by three moments later, Hamilton had a pass knocked loose by Lee which set up an open-court layup from Hughes with 53.9 seconds left that made it 110-105.
Two free throws from Prince cut it to 112-109 with 19 seconds left, but the Pistons failed to get within three from there on out.
It was a 28-28 deadlock after the first quarter but the Pistons opened a 56-48 lead at the half.
New York's deficit hovered around six points in the third quarter until Stuckey hit a jumper, McDyess had a pair of buckets and Amir Johnson offered a tip-in for a 12-point Detroit cushion.
The Pistons were up 81-71 heading into the fourth.
Trailing by 12 early in the fourth, Chandler had five quick points, Jared Jeffries offered a layup and Robinson followed suit to make it 83-80 with 9:08 left in the game.
Down by three late in the game, Robinson connected on a layup to bring the Knicks within 95-94 with 2:46 showing on the clock.
The Knicks' deficit bounced between three and one from there, before Stuckey was fouled with 12.7 ticks left and hit both shots for a 101-98 Pistons lead.
Hamilton, foolishly, fouled Hughes on a three-point attempt with 10 seconds showing, and Hughes hit all three shots to tie it at 101.
The Pistons couldn't get a shot off in the final 10 seconds and the clubs headed for overtime.