The Knicks gave it the good, old J.R. try against the Western powers from Oklahoma City.

Ultimately, they lived by J.R. Smith last night, then died by J.R. Smith last night.

With Carmelo Anthony sitting out a second straight game with a right-knee injury, coach Mike Woodson put Smith in position to be a last-second hero again and the team’s sixth man extraordinaire electrified the Garden with his Knick-career-high 36 points.

But Smith cooled off in the fourth quarter. He missed his final two shots in the last 30 seconds, including a tough, 17-foot fallaway from the left side over Russell Westbrook with 1.8 seconds left, as Oklahoma City escaped with a 95-94 victory in a Garden thriller.

No third buzzer-beater this time for Smith, the first Knick this season to score 30 points other than Anthony.

“[I] can’t say it was a great night,’’ Smith said. “I’ve had high-scoring nights, but it doesn’t mean anything when you come out with a loss.’’

Woodson, who chose Smith over Amar’e Stoudemire in the final moment, said he wished Smith drove the ball. Jason Kidd inbounded to Smith with 7.8 seconds left. Smith backed in Westbrook, chewing up the clock, before lifting the jumper that hit the far rim as the buzzer sounded.

Smith agreed he should have taken it to the hole immediately but also said he wanted to kill the rest of the clock and not leave time left for Kevin Durant (34 points).