NEW YORK – Paul Pierce thought it was good. So did the fans who roared in celebration at what appeared to be the victory that would punctuate the New York Knicks’ return to relevance.

Ray Allen knew otherwise, and so did the referees.

Amare Stoudemire’s 3-pointer came just after the final buzzer, giving the Boston Celtics a thrilling 118-116 victory Wednesday night and their 11th straight win.

“It was great basketball. It was a great Eastside barnyard knockdown, backyard scuffle, if you will,” Boston’s Kevin Garnett said. “Good basketball, though.”

Pierce made a tie-breaking jumper with 0.4 seconds left to win it. The Knicks’ eight-game winning streak is over, but a dormant rivalry might be back.

“We definitely earned our respect,” Stoudemire said. “I guarantee you right now Boston respects us. We’re no slouch. We’re ready to play every night. Boston knows it.”

Pierce’s late jumper proved to be enough for the Celetics after a video replay of Stoudemire’s shot showed the ball was clearly still in his hands as time expired.

“The Knicks are playing great basketball, can’t take anything away from them, and I actually thought Amare’s shot counted,” Pierce said. “I would have been stunned there for a minute, especially after all the theatrics, so I’m glad we got the win.”

Pierce scored 32 points for the Celtics, who trailed most of the night before running their record to 20-4, best in the Eastern Conference.

Stoudemire tied a season high with 39 points, extending his franchise-record streak to nine straight 30-point games. But the Knicks were denied the victory they crave over a top team.

Allen scored 26 points and Garnett had 20 points and 13 rebounds for the Celtics, enjoying their fifth winning streak of 10 games or more since their Big Three came together before the 2007-08 season.

Raymond Felton had 26 points and 14 assists, Danilo Gallinari scored 20 points and Wilson Chandler had 18 points and 12 rebounds for the Knicks, who lost for just the second time in their last 15 games.

Most of those victories came during a soft part of the schedule, leaving the Knicks needing a victory over an established NBA power to prove doubters they were back, despite their 16-10 record.

The Celtics just wouldn’t let it happen.

Stoudemire’s dunk snapped a 94-all tie with 8:05 left, and the Knicks stayed ahead until Garnett made two free throws with 1:29 remaining. Felton was late getting back after landing hard on a missed drive and the Celtics swung the ball around to Allen, whose 3-pointer gave Boston a 116-113 lead with 1:02 to play.

Gallinari answered with a three-point play and the Knicks got the ball back after the Celtics threw it away trying to find Allen, but Stoudemire’s shot from the lane rolled out.

Pierce ran the clock down and created enough space to make his shot over Stoudemire, who had picked him up on a switch. After a timeout, the Knicks inbounded the ball to Stoudemire behind the arc, and the Madison Square Garden crowd that was standing for most of the final minutes roared when his shot went through.

But the referees had ruled it came too late, and with the Celtics standing behind them as they watched it again on video, they saw their judgment was correct. 

SHAQ SITS: Center Shaquille O’Neal missed his third straight game Wednesday night, sitting out against the Knicks because of a sore right calf.