"It's a shot I can make and, honestly, it was the only shot he was giving me," Williams said.
The Sixers blew a 15-point lead and were on the brink of losing their third straight game as they make a push for the eighth seed in the Eastern Conference.
Williams delivered with a clutch basket at the end of a quarter like he has throughout the season. He buried a 3 over a lunging John Salmons for a 95-94 lead -- and helped the Sixers win for the first time (1-7) in games decided by four points or fewer.
"He's fearless," forward Elton Brand said. "That's why he's in that position at the end of games to take those big shots."
The Bucks, who began the day percentage points behind the ninth-place 76ers, failed to score on two more possessions. Earl Boykins missed a 3-point attempt as time expired to deny the Bucks what would have been a gutsy road victory.
"It hurts because we battled, we fought back," Drew Gooden said. "They had to come back for us to fight back that much on the road."
One week ago, Philadelphia played its best game of the season in a win against the Bulls. The Sixers failed to build off the victory and start a playoff run against inferior opposition, losing two straight to sub-.500 teams Detroit and Indiana.
"We could have been close to .500," Brand lamented. "But we got this one."
Coach Doug Collins stressed before the game the Sixers had to protect their home court and stay away from prolonged losing streaks that could plummet them to 12th or worse in the East in a short span.
"We played pretty good offensively, but couldn't get anything going defensively," coach Scott Skiles said.
The Bucks needed the help for the first three quarters, though it might not have mattered much with how the Sixers shot the ball in the first half. The were 20 for 32 (62.5 percent) from the field, their best shooting half of the season.
When they cooled off, the Bucks were there to take advantage.
Gooden, who scored 12 points, was dangerous off the bench in the fourth and Salmons and Keyon Dooling all chipped in with key baskets. The Bucks went ahead midway through the fourth on Salmons' 3.
From there, the Bucks and Sixers traded buckets and made few clutch defensive stops.
Maggette's driving layup put the Bucks ahead 94-92 but they failed twice to score on the same possession after Iguodala muffed the ball. That set up the go-ahead possession for the Sixers and Williams knocked it down for his latest game-changing basket.
Salmons missed an 18-footer and Elton Brand grabbed the rebound to hold off one scare. Williams' attempt to draw a foul on a jumper backfired and the ball never hit the rim.
That gave the Bucks one last chance. Maggette missed a jumper, the ball was kicked out to Boykins and the 3 attempt was no good.
"There was ain't no way I thought that thing was going to miss," Collins said. "Every one of those shots has gone in against us this year."
Not this one. Collins hugged his players in celebration and the Sixers avoided a big scare.
The Sixers are 10-3 at home after a 1-4 start. ... Andrew Bogut had 10 points and 12 rebounds for the Bucks. He's offering fans an "NBA Dream Package" on eBay to raise money for communities in Australia after the recent floods. ... Williams has scored 20-plus points in four of his last 11 games after doing it once in the first 20 games. ... The Bucks scored 26 points in the paint, well below the 43.7 points teams averaged against the 76ers over the last seven games.