Yes, the Knicks lost Monday on Dirk Nowitzki’s buzzer-beating heave, but they’ll feel they were robbed seconds earlier when J.R. Smith insists he got fouled by Monta Ellis, pleading for a whistle that never came.

Video shows he got hit across the arm by the Dallas guard. It remains to be seen if he’ll get slapped on the wrist by the NBA offices for earlier tugging at Vince Carter’s headband.

Either way, he argued vehemently, but futilely for the call — and the Knicks know all about futile. Their 110-108 heartbreaker against Dallas was their third straight defeat, and ninth in their last 11 games.

“It’s just what’s going on right now. It’s kind of numbing right now. You can’t get a win when you need one, and things just not going your way when you want it to. But that’s life,’’ said Smith, who never expected the Knicks’ 21-36 implosion of a season.

“Nah, not even close. If somebody had bet me a million dollars, I would’ve took that bet all day. It sucks; I ain’t going to lie. It sucks. It’s a tough spot to be in. But we’re in it, and we’ve got to fight out of it.’’

It’s been a tough season for Smith, from knee surgery to his suspension for marijuana use, to his failed stint as a starter to multiple benchings. Oh, and there was the fine for twice untying opponents shoes, so on Monday he tried pulling down Carter’s headband. That didn’t help either.

“No, your eyes are playing tricks on you. Y’all reaching for that one. I already got fined once this season for that [stuff],’’ grinned Smith, despite video that clearly showed him pulling down Carter’s headband with the Knicks trailing 90-85 with 10:43 left in the game.

The fine was $50,000 for untying Dallas forward Shawn Marion’s shoes on Jan. 5 and — after being warned about the error of his ways — trying to untie Greg Monroe’s in the very next game. He faces the prospect of another fine from Rod Thorn, the NBA vice president of basketball operations.

Larry Bird did the same thing to Chuck Person during the 1991 playoffs, and was lauded. Smith has learned enough to know he’ll be lambasted.

Smith had 15 points, seven assists and four rebounds, but couldn’t buy the two points the Knicks needed. When Carmelo Anthony got closed down in the waning moments, the ball swung to Smith, who elevated for a 22-foor jumper. Ellis appeared to hit him with 11.9 seconds left, but there was no foul called. The Knicks got whistled for a shot clock violation 2 ¹/₂ seconds later, and Nowitzki hit the winner at the buzzer.

Asked if he thought he got fouled, Smith said: “Do I think or do I know? I got hit. But it’s all right. It’s karma. The same guy I yelled at and got a tech on [with 4:03 to go in the third] was in the right position. So it’s just karma. … As blatant as it was I thought [they would call it]. But it is what it is.’’