NEW YORK (AP) -- Blowouts or squeakers, playoffs to preseason. You name it, the Miami Heat found a way to lose it.
Not this time.
Jason Williams made the go-ahead jumper with 19 seconds left, and the Heat earned their first victory of the season by beating the New York Knicks 75-72 on Sunday night.
"It was a much-needed win for us," center Shaquille O'Neal said. "We have folded under the pressure the last couple of games."
Swept in the playoffs, winless in the preseason and 0-5 to start this season, the Heat walked off as winners for the first time since beating Indiana on April 13 in their 80th game of last season.
"I don't like to lose," Heat coach Pat Riley said. "It's not much fun. Not a whole lot of joy as a team when you're in it."
With Dwyane Wade still out and Zach Randolph not here after his grandmother's death, both teams were missing their top players. And it showed with long stretches of inept offensive play on both sides.
But the Heat pulled it out after trailing by five with 2½ minutes left. Udonis Haslem made consecutive baskets, and after Stephon Marbury threw the ball away, Williams knocked down his jumper for a 73-72 lead.
The Knicks turned it over again trying to get the ball into Eddy Curry, and Williams added two free throws with 9.4 seconds remaining. Marbury then missed a potential tying 3.
Haslem finished with 16 points and 16 rebounds for the Heat (1-5), the last Eastern Conference team to win after Washington beat Atlanta earlier Sunday. Having rebounded from an 0-7 start to make the playoffs in 2003-04, Wade's rookie year, Miami is ready to begin a similar climb.
"The 0-7 team I don't think was as talented as this team," Haslem said. "I think we have a lot more talent on this team. But at the same time, like I said, we just haven't been able to get stops down the stretch."
Curry scored 19 points for the Knicks, who lost their last two to finish 2-2 on a discouraging four-game homestand. New York shot 37 percent, had 18 turnovers against 11 assists, and begins a four-game western trip Tuesday at Phoenix.
"I think we just fell apart," Curry said. "They took the game away from us. They made plays at the end and took it away from us."
Williams scored 17 points, and O'Neal and Ricky Davis each added 14 for the Heat.
David Lee had 14 points and 14 rebounds in his first start of the season for the Knicks. He replaced Randolph, who had double-doubles in each of the first four games but left for Indiana on Saturday after learning of his grandmother's death late Friday.
With Lee in the lineup and Nate Robinson playing just 3 minutes because of a sore hamstring, the Knicks' bench lacked its usual production, managing just four points.
Marbury had 14 points and Jamal Crawford 13 for the Knicks. Crawford, who scored 52 against the Heat here last season, was just 4-of-14 from the field.
Wade resumed practicing earlier this month, but doesn't want to come back too soon and risk being in and out of the lineup. He could make his season debut Tuesday at Charlotte.
Without him, Miami has the worst offense in the league, averaging just 84.5 points. The Heat scored 25 points in the first quarter, then had just 27 combined over the next two.
Still, they stayed in the game and were down only one with under 5 minutes to go after five straight points from Davis. But they turned it over on consecutive possessions with a chance to take the lead, with Lee's dunk on the second one giving the Knicks a 70-67 lead with 3:24 left.
Curry added two free throws with 2:30 to play, but that was it for the Knicks.
"We got to play hard for 48 minutes," said Knicks forward Quentin Richardson, who left with a hyperextended right elbow after Davis landed on his arm diving for a loose ball. "We can't lose a game like this any time. They've been struggling right now. We should win this game."
The Heat led 25-20 after one and were ahead 35-24 after O'Neal's hook shot with 5:06 remaining in the half. The Knicks scored the next 10 points, then brought a 39-37 lead into halftime after Marbury's 3-pointer with 37 seconds left.
Marbury hit another 3 in the final second of the third quarter, sending the Knicks to the fourth with a 58-52 lead.
Knicks coach Isiah Thomas said before the game he doesn't know when Randolph will return. ... Knicks G Mardy Collins made his first appearance of the season late in the first quarter. ... Even with their 0-5 start, the Heat were a long way from the worst start in franchise history. They lost their first 17 games in 1988, their first season.