NBA

Lin hits last-second 3-pointer; Knicks defeat Raptors

TORONTO ­— Jeremy Lin called his sudden 10-day phenomenon “a miracle from God’’ — and that was before he completed a miracle comeback with a miracle final-second 3-point shot.

The fairy-tale story carried north of the border and got even more spectacular as the Knicks point guard dribbled down the clock in a tie game against the Raptors, wanted the last shot, got it and made it.

Waving off a high pick and roll, “Linderella’’ drilled a game-winning straightaway 3-pointer with 0.5 seconds left to cap a comeback from 17 points down and lift the Knicks to a 90-87 win, each victory crazier than the last.

Lin’s shot sent the Knicks (14-15) onto a six-game “Linning streak’’ as a jubilant Air Canada Centre crowd belted out a giant roar when the ball fell through.

On Asian Heritage Night, the “Linsanity’’ craze hit Canada in a big way, and Lin was cheered through much of the night as the Knicks rallied from nine points down in the final 4:15, with Lin scoring the Knicks’ last six points.

“I’m glad it went like this so we can calm the Linsanity down,’’ coach Mike D’Antoni said jokingly.

Lin finished with 27 points and 11 assists for his second career double-double. He shot 9 of 20 from the field and hit 7 of 11 free throws, his eight turnovers an afterthought by game’s end.

On the final play, Lin let the clock wind down to 2 seconds before even making his move.

“He was pretty confident that was going in,’’ D’Antoni said. “No rebounds. Nothing. That ball was getting buried. [We wanted] a pick and roll. He didn’t want the pick and called off the pick and said ‘I’ll take it.'”

The global icon said he felt Raptors defender Jose Calderon was daring him to shoot.

“He tried to push me left and gave me a bit of space, and I just figured that it probably is not going to be possible to get to the basket with the help they had,’’ said Lin, who was crunched on his basket forays all game.

“I am not going to stop shooting if I think it is a good shot,’’ Lin added. “I understand my percentages and there’s a criticism people have of me. Thankfully my teammates trust me with the ball at the end of the game. I like having it at the end of the game.’’

D’Antoni was not about to call a timeout after Tyson Chandler pulled down a defensive rebound with 21 seconds left.

“He’s too good to call timeout,’’ D’Antoni said of Lin’s decision-making. “He’s a tough kid. You don’t know that until you go into games with him, and there’s no way anybody could see that before the last two weeks. But he’s really tough. Mentally he’s there.’’

The locker room filled with joy and one Knicks staffer said, “I’ve been here 20 years and these are in the top two, three moments.’’

Lin, who has scored 20 points with at least seven assists in all six wins since he started getting major playing time, outdid himself late in this one. His 3-point play on a hard drive with 1:05 tied the game and set the stage for his game-winner as the Knicks held the Raptors (9-21) to 12 fourth-quarter points.

“The amount of fun we’re having is unbelievable,’’ Lin said. “And it’s not because of me. It’s because we’re coming close as a team.’’

Amar’e Stoudemire shook off his early rust and powered the comeback with a big fourth quarter and finished with 21 points, but shot 8 of 22.

The Knicks were down 86-77 with 4:15 left and finished on a 13-1 run. Rookie defensive whiz Iman Shumpert stole the ball at midcourt and scored on a fastbreak dunk to make it 87-84 with 1:28 left.

“They didn’t want to lose again,’’ D’Antoni said.

Jared Jeffries got annoyed when someone mentioned Lin had struggled because of his turnovers rate.

“We’ve told him it’s not how you start, it’s how you finish,” Jeffries said. “There isn’t a player in the league playing better than him. He’s still so humble. I don’t know how he does it.’’

More than 10 percent of the Toronto population is Chinese and the Air Canada Centre fans cheered him loudly during introductions, roared when he first touched the ball and roared even louder when he sank long jumpers.

Then there was one last explosion when he made the game-winning bucket.

“I believe in the all-powering God who does miracles,’’ Lin restated after the win.

It wasn’t all highlights for Lin, who struggled defending Calderon, who finished with 25 points. But the Knicks made a switch and got Shumpert to shut down the Spanish point guard.

“I am just glad we had the opportunity for us to be tied at the end of the game just because we came out flat,’’ Lin said. “I let Calderon probably have 20.’’

marc.berman@nypost.com