NEW YORK — A brief lull nearly sent the Boston Celtics home on Christmas Day with the wrong result.

A deft pass from Al Horford and a clutch shot from Marcus Smart restored order for the Celtics.

Horford found Smart for the tiebreaking 3-pointer with 47.8 seconds remaining in the fourth quarter as Boston blew a 13-point lead before escaping Madison Square Garden with a 119-114 victory over the New York Knicks on Sunday.

The Celtics seemingly had their fifth win in six games secure when they held leads of 109-96 with 4:58 remaining and 112-104 with two minutes left. They wound up needing Smart’s clutch shot because the Knicks ripped off eight straight points and forged a 112-112 deadlock with 66 seconds left on a baseline layup.

Carmelo Anthony’s hoop forced the Celtics to call their final full timeout, and coming out of the stoppage, Jae Crowder was guarded by Kristaps Porzingis on the inbounds pass. Three other players touched the ball before it wound up in Smart’s hands on the left side near the Boston bench after Horford passed it out of the post.

“I was going for the shot,” Horford said. “It kind of was one of those things that I saw him there and you feel the defense out there sometimes. So it’s just about about making the right, easy play. I hit him and he hit a huge shot.”

Smart had enough time to set his feet and calmly hit the uncontested 3-pointer.

“He drew multiple defenders and kicked it out. I know most teams are going to leave me open,” said Smart, a 27.9 percent 3-point shooter this season. “I got an opportunity to knock down a big shot for my team.”

“It was the right play,” Boston coach Brad Stevens said. “You make the right basketball play as many times as you can and then good things will happen.”

On New York’s next possession, he was closely guarding Anthony when a 3-point attempt from near the top of the key did not go in. The Knicks grabbed the rebound but Avery Bradley stripped Anthony with 18.8 seconds left.

“We fought our way back and stayed in the game defensively,” Anthony said. “That big three by Marcus Smart gave them confidence to finish the game.”

Boston stretched the lead to 117-112 on a pair of Crowder free throws with 17.9 seconds left. A layup by Anthony made it a 117-114 game with 13 seconds left but Isaiah Thomas hit three of four foul shots in the final seconds.

“Al made a hell of a play out of the post to Smart, who made a big three,” Thomas said.

Thomas led the Celtics with 27 points while Crowder and Kelly Olynyk added 16 apiece. Horford and Smart contributed for 15 points each for the Celtics, who never trailed after the 5:14 mark of the second quarter.

Anthony led the Knicks with 29 points but shot 9 of 24 after starting 3 of 14 from the floor. Derrick Rose added 25 and Porzingis contributed 22 for New York, which dropped its fourth straight Christmas Day game.

“We made bad decisions and (the Celtics) were smart,” Porzingis said. “It is not only the end of the game but it is throughout the game we can get better.”

Before Horford’s pass to Smart, New York’s other opportunity to take the lead or tie occurred with 2:29 remaining in the third quarter when Courtney Lee capped a 9-0 run with a 3-pointer to cut Boston’s lead to 82-80. Smart hit an 11-footer on the next possession and the Knicks missed eight straight shots as the Celtics took a 93-82 edge on a short jumper by Thomas about one minute into the fourth.

NOTES: Before the game, Knicks F Carmelo Anthony in conjunction with his foundation presented a car to Jarell Lara and his family. The 17-year-old Jarrell Lara suffers from a rare form of cancer called Langerhan’s Cell Histiocytosis and just completed 18 months of chemotherapy. … Tony Brothers was not among the officials working Sunday’s game and has not officiated a Knicks game since ejecting Anthony on Nov. 11 in Boston. Anthony said after the game that the ejection may have been personal due to his history with Brothers. … Boston G Marcus Smart said he will probably need “one or two stitches” to his mouth when the team returns home. Smart was elbowed under the basket by Knicks PG Derrick Rose and the contact resulted in blood streaming from his mouth. …. Boston’s last three Christmas Day games have taken place in New York. The Celtics also played at the Brooklyn Nets in 2012 and lost by two against the Knicks in the season-opener of the 2011-12 lockout-shortened campaign. … Knicks F Maurice Ndour (sprained right ankle) was not active.