DAVID'S GOLIATH: David Lee, who scored 29 points, shoots over the Toronto's Amir Johnson during the first half of the Knicks' 106-104 loss to the Raptors last night in the Garden.EPA

DAVID Lee, going against taller player almost every night, is averaging 19.4 points, 11.4 rebounds and 3.4 assists per game, but it wasn’t good enough to make him an All-Star, because the Knicks aren’t good enough to rate one.

“If we’re third in the league, he makes it in a heartbeat,” coach Mike D’Antoni said. “All coaches, when they can’t decide, will look at the [team] record.”

Perhaps in the next life the Knicks will have an All-Star again, especially if LeBron James arrives on a white horse, robes flapping in the breeze like Jets coach Rex Ryan’s gums. Instead, it’s the Knicks ninth consecutive season without a representative, and it directly corresponds to what is looking more and more like a eighth-year-in-nine without a playoff spot.

Lee played his heart out last night in the Knicks’ 106-104 loss to the Raptors and Chris Bosh, one of the players who won a spot on the Eastern Conference team and might beat Lee again in July for the big multi-year deal the Knicks weren’t offering last summer.

“My motivation was to win the game, not play a good game,” Lee said, after outscoring Bosh 29 to 27 and outrbounding him 18 to 15. He also kept the Knicks alive down the stretch with an offensive rebound and a putback of two Nate Robinson misses, plus a rebound of a missed Jarrett Jack free throw with seven seconds remaining.

It gave the Knicks, down two, one last shot. To no surprise, they blew it. Al Harrington was forced to drive to the basket and committed an offensive foul after Nate Robinson was successfully face-guarded and taken away from Danilo Gallinari on the throw-in.

Despite playing an impressive game, Lee, with a chance to put the Knicks up one with 40 seconds left, blew a layup he usually never misses after beating Bosh and Hedo Turkoglu.

But the Knicks best player still played a solid defensive game against Bosh.

“Anytime the other team’s top player shoots 10 of 24 you feel you have done your job,” Lee said.

It was Lee’s fourth game this season with 18 or more rebounds, and his seventh consecutive double-double. Nevertheless, The Knicks still lost for the seventh time in 10 games and fell five losses behind the eighth-place Bulls.

Regarding Lee’s non-selection to the All-Star tea, life is not fair. Not because we have watched Al Horford of the 29-15 Hawks or Gerald Wallace of the 22-22 Bobcats enough to declare both All- Stars inferior to Lee, but because it’s hard to imagine either doing more for their teams than Lee does for the Knicks.

The statistics might be inflated because he has a greater offensive burden on an 18-26 team. In a perfect Knicks world, Lee would be the team’s third-best player, but as their best one, he puts up a fight that can make a Garden crowd proud.

It might turn out that James will make them all forget Patrick Ewing, never mind David Lee. Team president Donnie Walsh will do what he has to do, as will Lee if he’s a better fit under someone else’s cap. Lee hasn’t turned the Knicks into winners in his five seasons, and it’s the reason why he is not a maximum contract player. It’s the reason the Knicks kept their options open last summer, giving Lee a one-and-possibly-done deal.

Nevertheless, the Knicks didn’t realize how much they would be getting for their $7 million this season.

“Could have been nine guys, but I’m prejudiced because I watch him every day and know how important he is to us,” said D’Antoni, referring to Lee’s All-Star snub.

You can read it in the statistics. You can feel it at the Garden. And you can see it in the disappointment in Lee’s face after a tough loss.