Knicks forward Kristaps Porzingis looks to shoot against Grizzlies forward...

Knicks forward Kristaps Porzingis looks to shoot against Grizzlies forward JaMychal Green in the first half on Wednesday, Jan. 17, 2018, in Memphis, Tenn. Credit: AP / Brandon Dill

MEMPHIS, Tenn. — Courtney Lee was furious and needed to be held back when the final seconds ticked off to end the game. The normally mild-mannered Lee’s ire was directed at referee Derrick Stafford.

Jeff Hornacek was disgusted as well following the Knicks 105-99 loss to a Grizzlies’ team with players mostly unrecognizable to people outside of Memphis. But his ire was directed at his players.

The Knicks played no defense for three quarters against Memphis without Marc Gasol, Mike Conley Jr. and Chandler Parsons. The Knicks were down 18 before they decided it was important to play defense.

They clawed back to get within three. But a wild ending where Lee was whistled for a rare technical on a jump ball in the closing seconds contributed to an awful Knicks’ loss to open their six-game trip against the Western Conference.

“That was meaningless,” Hornacek said of the technical. “It was from the start. We talked about setting the tone. We came out there and we were happy with not closing out on guys, giving guys easy shots We let them get going early. We played no defense. Down 18 now we all of a sudden want to play defense. That’s what we should have been doing from the start of the game.”

Hornacek had every right to be upset after the Knicks (20-25) fell for the 11th time in 14 games. But Lee made a strong argument for himself.

He and Grizzlies rookie Dillon Brooks had been going at it for much of the game. When they lined up for a jump ball with 17.8 seconds left, Lee said Brooks grabbed his arm, and the exchanged words. Lee implied Stafford overreacted and made it “personal” after the two disagreed on a call earlier. Lee said if Stafford called anything it should have been a double-technical, which wouldn’t have resulted in free throws.

Instead, Tyreke Evans made the foul shot to make it a 103-99. Then Evans won the jump ball on Tim Hardaway Jr. Evans was fouled and put the Grizzlies up six after making the free throws with 12.8 seconds to go.

“The rookie grabbed my arm,” Lee said. “I said, ‘Get off me.’ He said some other words. I said, ‘Look, you got the wrong one, Rook. You got the wrong one, young’n. He said, ‘Who are you? I said, ‘You know who I am. And then I get a tech. Exact word for word.

“If you’re going to give a tech in that situation when both of us is talking to each other, not even talking to you, it has to be a double tech. You can’t just come over there and give me a tech because you’re mad at me about something. Both of us was talking, no violent talk, no cuss words was even said, that’s a double-tech situation.”

Stafford told a different story to a pool reporter.

He said Lee “bumped Brooks” and Stafford “warned both guys to knock it off and let me toss the ball.” Stafford went on to say, “Lee used what I considered inappropriate language toward the young man so I called a technical foul.”

Lee, in his 10th NBA season, said he’s never seen a call like that. He said he argued earlier that Brooks kicked his leg out on a three-pointer and Jarrett Jack was called for a foul. Lee said he said, “Jesus Christ” and Jack said “Even God knows it was not a foul,” and Stafford took offense. Lee implied that it led to the later call.

“I just went up to him and said, ‘You can’t make the game personal, bro,’ ” Lee said. “I wasn’t even talking to him. I was talking to the rookie and nothing was even said that should have been a technical foul. I wasn’t even talking to the ref. You’re supposed to be getting ready to throw the ball up but you’re eyeing in on that situation. I wasn’t talking to him. It’s unbelievable.”

Kristaps Porzingis, and everyone on the Knicks’ bench, felt he should have gotten a call when he got a steal and was blocked going in for a fast break layup. Porzingis was whistled — by Stafford — for a loose-ball foul with 25 seconds left that also surprised the Knicks.

Porzingis ended up with 21 points, nine rebounds and six blocks. Enes Kanter scored 20, but just two after halftime. Michael Beasley and Lee each had 18. Hardaway Jr. returned from a one-game absence and had 16 points.

Evans led the Grizzlies with 23 points and 10 assists. JaMychal Green scored 18, and Brooks had 17.

Lee drilled a three-pointer with 48 seconds left to make it 102-99. Evans misfired on the next trip, but that’s when Porzingis was called for a loose-ball foul.

Out of timeout, Lee slapped the ball away from Evans, leading to a scramble, a pileup on the floor and the jump ball and they mayhem ensued.

“I’m not going to put myself in that situation to get a technical,” Lee said. “What I said is 100 percent accurate. Look at my track record.

“I don’t know what’s going on man. It’s really different now. I just really appreciate guys like Joey Crawford, Monty [McCutchen] and Dick [Bavetta] when those guys were reffing. You really appreciate those guys when you got them. I’m lost for words. I wasn’t expecting to get a technical like that because I wasn’t saying anything towards the ref and I wasn’t saying anything that should have gotten me a tech.”

Lee sets free-throw mark. Lee established a Knicks’ franchise record for consecutive free throws made. He now has hit 48 foul shots in a row and counting. Chris Duhon held the mark previous, hitting 47 straight during the 2008-09 season.