The 6-foot-6 Williams had a stellar performance while playing with a heavy heart. He dedicated the game to a close family friend, Mary Thompson, who died Wednesday.
Playing in her memory, Carter-Williams finished with 22 points, 12 assists, 9 steals, and 7 rebounds. His 9 steals were an NBA record for rookies in their first game.
Carter-Williams made 4 of 6 three-point attempts. And his clutch foul shots with 8.5 seconds left gave the Sixers (1-0) their four-point margin of victory.
"He was all over the place, very active," Heat center Chris Bosh said. "His wingspan is pretty good. He has a knack for getting his hand on the ball, and just the whole team [was] very aggressive, very fast."
Carter-Williams said he gained more confidence as the game went along.
That was evident as he finished with three points, three rebounds and a steal in the final 2 minutes, 44 seconds.
"I was figuring out their defense a little bit," he said. "I was able to get steals. I was hitting. My shot was on. That was a big plus."
Evan Turner led the Sixers with 26 points and added five assists. Spencer Hawes contributed 24 points and nine rebounds. LeBron James led the Heat with 25 points.
The Heat (1-1) were coming off Tuesday's season opener against the Chicago Bulls in Miami. They were also without all-star Dwyane Wade, who got the night off from coach Erik Spoelstra.
Early on, the Sixers took full advantage.
They made their first 11 shots and built a commanding 19-0 lead as the Heat missed their first nine shots. The Sixers led by as many as 22 points late in the first quarter.
The Heat went on to take a commanding nine-point lead at 94-85 after three quarters. They had an eight-point cushion (107-99) with 4:31 to play.
"We just all stayed together," Turner said. "We didn't flip out when we gave up the lead or anything. We all pretty much followed [Carter-Williams'] path. And we all stuck together."
The Sixers battled back and took a 109-108 lead on Hawes' layup with 2:06 left.
Then Michael Carter-Williams hit foul shots with 27.5 seconds left to give them a 110-108 edge.
Turner added a pair of foul shots to make it a 112-108 game with 19.1 seconds left. Miami closed the gap to 112-110 on Ray Allen's putback with 9.1 seconds remaining.
But after being fouled, Carter-Williams drained a pair of fouls shots with 8.5 seconds left. The Heat's Mario Chalmers missed a long jumper with a second left as the Sixers pulled off the upset.