Updated

Ersan Ilyasova scored 26 points, including a critical putback in the final minute, and the Milwaukee Bucks held on for a 119-114 victory over the New York Knicks on Friday.

Brandon Jennings and Mike Dunleavy added 25 points each for the Bucks, who were coming off a last-second loss at home to Chicago on Wednesday.

Amar'e Stoudemire had 27 points and 11 rebounds for the Knicks, who have lost four straight and seven of their past 10. Carmelo Anthony had 22 points, while Jeremy Lin had 20 points and 13 assists, with four steals and five turnovers.

The game had some significance to the Eastern Conference playoff picture. The Knicks came into the game holding on to the No. 8 playoff spot in the East, with the Bucks three games behind. Milwaukee's win cuts the deficit to two.

Ilyasova was coming off a career-high 32 points in Wednesday's loss to the Bulls, and has had double-digit points and rebounds in three of his past five games. Coming into Friday, Ilyasova was averaging 18.5 points and 11.6 rebounds per game over his previous 11 games.

The Knicks hit their first 11 shots from the floor, racing out to a 28-18 lead — including an impressive alley-oop pass from Lin to Landry Fields.

But the Bucks closed the first quarter on a 14-2 run that included a pair of 3-pointers by Dunleavy, who had 14 points in the first quarter. The Bucks led 36-34 going into the second quarter, but the Knicks came back for a 65-61 lead going into halftime.

But the Bucks erased that lead with a 16-7 run to start the third quarter, including 3-pointers on back-to-back possessions by Jennings and Carlos Delfino.

Milwaukee led 93-83 to begin the fourth, then got quick scores from Delfino and Larry Sanders to extend their lead to 97-83 early in the quarter.

With the Bucks already leading by 13, Lin gave the ball away to Jennings, who darted down the court, spun around Baron Davis and sank an acrobatic layup to put Milwaukee up 108-93 with 7:28 left.

But the Knicks got back in the game with a 10-0 run, cutting the lead to 108-103 on a baseline spin move and layup by Davis with 5:34 left.

After a timeout, the Knicks extended the run to 12-0 and cut the lead to three on an alley-oop slam dunk from Davis to Fields.

Delfino then hit a 3-pointer for Milwaukee to stop the run.

Later trailing by five, Lin hit a long jumper and Davis drove for a layup to cut the lead to one with 2:45 left.

A foul sent Ilyasova to the line, and hit both free throws to put the Bucks up by three. Anthony drove for a layup on the other end, cutting the lead back to one with 52.7 seconds left.

Lin then hounded Jennings into throwing up a wild shot with the shot clock running down — but Ilyasova was there for the putback, giving the Bucks a 116-113 lead with 28.7 seconds left.

Stoudemire then tried to drive for a layup, but was called for traveling.

The Bucks then were called for a five-second violation on the inbounds play, and Anthony tried to drive for a dunk and missed. A foul call on Drew Gooden sent Anthony to the line — enraging Bucks coach Scott Skiles — but Anthony missed the first and hit the second to cut the lead to two with 10.8 seconds left.

The Bucks got the ball in this time, and Jennings was fouled. He hit both free throws to put Milwaukee ahead by four with 9.7 left.

Notes: Knicks guard J.R. Smith brushed off attention he received after posting a photo of a scantily clad woman on his Twitter account. "I get a lot of criticism for everything, so I'm not really worried about it," he said. ... The Bucks got back defensive stopper Luc Richard Mbah a Moute, who had missed two games with a sore right knee. But Mbah a Moute had to leave the game after playing only 7:39 because his knee flared up again. ... Bucks guard Shaun Livingston left the game with a left ankle injury.