The Knicks took the floor at Madison Square Garden on Christmas with their spirit for giving in the right place but their priorities backward.

Consider two statistical trends that jumped out from the final boxscore after the Celtics’ 119-114 victory Sunday:

The Knicks totaled a miserly 11 assists on 41 made field goals and had 17 turnovers.

The Celtics totaled 25 assists on 45 made field goals and had six turnovers.

So, to review: The Knicks (16-14) did not give up the ball when they should have and did give it up when they should not have. The Celtics (18-13) did the opposite.

The result was what players agreed was a loss that felt extra bad because of the national showcase and a holiday crowd at the Garden that ached for a rare victory over an opponent with a winning record.

advertisement | advertise on newsday

After falling behind by 13 with 4:58 remaining, the Knicks produced a 16-3 run that tied the score at 112 with 1:06 left, but Marcus Smart hit a three-pointer 19 seconds later to give the Celtics the lead for good.

“You don’t want to lose at all, but to lose today, it was a tough loss,” Carmelo Anthony said after rallying from a 1-for-10 start to finish with 29 points and 9-for-24 shooting.

As often is the case, he was at the center of the action when it mattered most — both good and bad.

After three-pointers by Anthony and Kristaps Porzingis and a three-point play by Porzingis cut the Knicks’ deficit to two, the highlight came with 66 seconds left when Anthony completed an 8-0 run to tie it at 112 and ignite the crowd. The score came on a layup off a gorgeous feed by Joakim Noah to the cutting Anthony, who had begun the play by tossing the ball to Noah. An assist!

But Smart hit an open three-pointer from the corner off a pass from Al Horford with 47.8 seconds left. The Knicks had trouble defending Boston’s threes throughout; the Celtics made 14 on 36 tries.

After Anthony missed a three-pointer and Noah rebounded, Anthony dribbled near the sideline as the clock wound down and the fans rose in anticipation.

The Celtics had switched Avery Bradley on to him. Anthony could not and/or did not get rid of the ball, Bradley got a piece of it and Anthony turned it over. That occurred with 18.8 seconds left, and the Knicks never recovered.

“He got his hand on the ball,” Anthony said. “He made a good defensive play. I don’t want to take that away from him.”

Derrick Rose, who had 25 points, and Porzingis, who had 22 points, 12 rebounds and four blocks, could only watch helplessly as the ball rolled away to the Celtics’ Jae Crowder.

“We had Melo with the ball,” Rose said when asked about his lack of involvement. “If the coach wanted me to have the ball, I’d have the ball, but I’m not the coach or the coaching staff. My job is to go wherever they want me to go.”

advertisement | advertise on newsday

Said Porzingis, “I was ready to shoot it if I had a chance, but we trusted Melo in that situation, and sometimes you knock down big shots and sometimes you don’t.”

The Celtics were led by Isaiah Thomas with 27 points in a game that featured on-court testiness — notably between Anthony and Horford. There were three technical fouls on the Knicks and one on the Celtics.

Coach Jeff Hornacek said the Knicks’ ball movement was lacking at times, but Porzingis noted that their style and personnel do not always lead to high assist totals, even in good times. “A lot of it is [isolation plays] for guys and guys making one-on-one plays,” he said. “I’m not really worried about that too much.”

Anthony said the Celtics mostly rely on one-on-one defense with limited help, which encourages more one-on-one offensive play. “I honestly didn’t see any issue with the ball movement today,” he said. “It was one of those days when I thought we did move the ball . . . I don’t think us having 11 assists was any indication of the way we played.”