Pierce ended with 20 points, nine rebounds, and five assists for the Celtics, who have lost just one of their five exhibition games. Ray Allen scored 24 points for Boston, which got 16 points from Luke Harangody.
Kevin Garnett finished with six points before being ejected in the second quarter for picking up two technical fouls. Glen Davis (knee) and Shaquille O'Neal (hip) did not play Wednesday.
Amare Stoudemire tallied 30 points and five boards for the Knicks, who got 13 points from Wilson Chandler.
With the score tied at 101, Pierce, celebrating his 33rd birthday, made a jumper from near the top of the arc to put the Celtics up by two with eight ticks left on the clock. Andy Rautins missed a three-pointer at the other end, and Pierce made 1-of-2 from the foul line to make it a 104-101 game with 2.7 seconds remaining. Ronny Turiaf missed two foul shots for the Knicks with 1.5 seconds to go