The Knicks had the ball in the waning seconds and three shots to win a game they absolutely needed. But when things are going bad, nothing falls for you.

Derrick Rose had his layup blocked by Paul Millsap. Carmelo Anthony got the rebound, but his short baseline shot was long. Joakim Noah’s tip hit the front of the rim.

For the third time in eight games, the Knicks lost a heartbreaker by one point, falling to the Hawks, 108-107, on Monday afternoon at Madison Square Garden.

“When things are not going your way, sometimes they go all the way left,” Anthony said.

Anthony was referring to his shot, but he could have been speaking about the season as a whole after Dennis Schroder’s three-pointer with 22.4 seconds left sent the Knicks to their 11th loss in 13 games.

Jeff Hornacek made a change to the starting lineup, but in the end, the Knicks (18-24) fell a season-worst six games under .500.

advertisement | advertise on newsday

Anthony scored 30 points and shot 10-for-16, but he missed the one the Knicks had to have. Rose had 18 points, nine assists and six turnovers. One turnover was on a questionable charge call with 2:33 left, as former Knick Tim Hardaway Jr. appeared to be moving when contact was made. Noah added seven points and 17 rebounds.

Schroder shot 13-for-16 and scored 28 points. Hardaway added 20, including a huge three-pointer with 2:53 left to put Atlanta up 103-101. Millsap had 17 points, seven rebounds and six assists for the Hawks, who were without Dwight Howard (rest day).

Looking for some kind of spark, Hornacek made an unexpected change. He started undrafted guard Ron Baker (12 points) in the backcourt and brought Courtney Lee, who signed a four-year, $48-million deal last summer, off the bench.

“Right now, you come in here, you don’t know what’s going to happen,” Brandon Jennings said.

Hornacek hinted that he would have started Kristaps Porzingis at center if he could have played, which implied that Noah would have come off the bench. But Porzingis missed his third straight game because of a sore left Achilles.

Despite the change, the same thing hurt the Knicks in the end: defense.

They went ahead 103-98 on Anthony’s jumper with 3:02 left and 107-105 on Rose’s floater with 43.1 seconds to go. But the Knicks needed a stop and, as usual, couldn’t get it.

Milwaukee’s Giannis Antetokounmpo buried the Knicks with a buzzer-beating fall-away jumper Jan. 4 and Philadelphia’s T.J. McConnell crushed them at the horn with a turnaround jumper Jan. 11. This time it was Schroder, who was wide open and delivered the dagger.

advertisement | advertise on newsday

Atlanta worked the ball inside to Kris Humphries, and he threw it out to Schroder on the left wing. Rose, who has preached about the Knicks needing to play harder defense, was late on the close-out. Schroder made him pay, as he had all game.

Rose didn’t sprint out at Schroder on that game-deciding play and admitted he should have closed harder on him.

“Of course,” Rose said. “At the same time, I didn’t think he was going to shoot that shot. I thought he was going to try to pump fake and drive. He hit a tough shot. He was hitting tough shots the entire game. People were there. This was his night.”

Bad strategy. Hornacek said it wasn’t “a game on the line” close-out.

“Even if he makes a two, we’re still going to get the ball back on the last shot,” Hornacek said. “Just a little harder close-out, he was almost there, but when the game’s on the line, a good challenge of a shot isn’t as good as not letting him shoot it.”

advertisement | advertise on newsday

The Knicks still had one last possession — and three shots.

Rose and Anthony ran a pick-and-roll, and with Thabo Sefolosha and Kent Bazemore cheating toward Anthony, Rose got an open lane to the basket. But Millsap met him at the rim and blocked it into Anthony’s hands. His turnaround fadeaway hit the back side of the rim, and Noah’s tip was short. After a mad scramble, Schroder chased down the rebound.

“That’s a shot I think I can make in my sleep,” Anthony said. “I just missed it.”