Wins -- let alone this kind of dramatic victory -- have been rare in this 9-39 season.
But Monday was especially important for Milwaukee because they fended off numerous runs by the streaky Knicks, who lost a second straight following a four-game winning streak.
This is the same team that's also had streaks of five wins and nine losses, too. New York hopes this isn't the start of another bad run.
New York rallied from a 10-point deficit in the fourth quarter, but ended up falling to the worst team in the league two nights after losing to the Southeast Division-leading Miami Heat.
"There are no freebies in the NBA. You can lose on any night to any team if you don't play well," said center Tyson Chandler (seven points, 10 rebounds).
Middleton hit a season-high five 3s for Milwaukee, which also snapped a seven-game skid to New York.
Rookie Giannis Antetokounmpo had 15 points and sparked the crowd that included his family with a rousing dunk in the fourth quarter, while Zaza Pachulia also gave the Bucks a lift off the bench with 12 points and seven rebounds.
New York was usually never more than a few possessions away and the last few minutes got even tighter.
Anthony hesitated before firing up a 3 with 19 seconds left to tie the game at 98 before Knight's last-second heroics.
Unlike most of the rest of the season, the Bucks had a counterpunch for every Knicks spurt.
"I made some mistakes at the end that can cost us the game, but Brandon was there," Antetokounmpo said. "The hero was there to knock down the shot."
Knight's back-door layup off a pretty feed by Pachulia with 27.5 seconds left gave Milwaukee a three-point lead to answer Felton's 3 on the previous possession.
Anthony finished 13 of 25 from the field and 5 of 10 from 3-point range. J.R. Smith had 30 points and seven rebounds.
Knight went 10 of 23 from the field and 4 of 8 from long range.
"My teammates did a great job tonight persevering," Knight said. "Our past habits have been to drop our heads and say `Here we go again.'"
New York led by seven early and had plenty of chances to gain control but went through inopportune dry spells and went just 15 of 24 from the foul line. Chandler was 1 of 6.
NOTES: Iman Shumpert returned to the Knicks' starting lineup after missing two games with a sprained right foot. He finished with five in 24 minutes. Forward Kenyon Martin sat out again with a nagging left ankle injury. ... Bucks F Caron Butler left in the fourth quarter with a sprained left ankle.