As he was walking out of the press conference room, having not talked about Danilo Gallinari at all, Mike D’Antoni, unsolicited, had a parting observation.

“Probably played his best game he played all year,” D’Antoni said of his small forward.

Gallinari was brilliant in last night’s 124-106 victory over the Pistons at Madison Square Garden, pumping in 29 points — on only 12 shots. He hit seven of them, including 4-of-7 from three-point range, and nailed all 11 free throw attempts.

Gallinari added five rebounds and paced everybody in the building with 11 fourth-quarter points.

It’s the third time in the last five games that Gallinari reached the 20-point barrier. In those five, he’s averaging 20.2 points and shooting 47 percent (28-of-60) from the floor.

“I was feeling pretty good,” Gallinari said. “We had [Wilson Chandler] and Shawne [Williams] out. We all had to step up pretty good.”

After missing six games early in the month with a sprained left knee, Gallinari returned and played well for three games — but nothing outstanding. His last five, though, he’s emerged.

As he did in the fourth quarter last night. With the game tied at 91, Gallinari opened the quarter with a 3-pointer. Then, with the Knicks ahead 98-93, Gallinari pulled up from 26 feet.

Twenty-six!

“When he did it, for some reason, I’m like, ‘That’s going in,’ “ Landry Fields said. “He’s been feeling it all night.”

Gallinari drilled it, pushing the Knick lead to eight.

In the first half too, Gallinari was active, authoring a driving one-handed jam, delivering a nice drive-and-feed to Timofey Mozgov for a two-handed dunk and hitting a trey from the wing to put the Knicks ahead 57-56. In the second half, Gallinari hit two 3’s and his other hoop was a driving layup in traffic, finishing the play lefty to cut the Pistons’ lead to 77-71 and starting an 8-0 Knick run.