Williams scored his second goal at 13:37 of the third period and was followed by Chicago's Tony Salmelainen and then Danny Markov within 50 seconds to make it 5-3.
Robert Lang and Williams scored 1:42 apart in the second period for the Red Wings, then Craig MacDonald had a goal 1½ minutes later to pull Chicago within a goal.
The Red Wings improved to 20-1-1 when leading after two periods.
Detroit's Chris Osgood, who gave Dominik Hasek the night off, made 33 saves. Tomas Holmstrom scored the first goal and Kris Draper added an empty-net goal in the final minute for the Red Wings, who have won three straight and six in a row at home.
Nikolai Khabibulin made 26 saves for the Blackhawks, who have lost four straight. Brent Seabrook opened the scoring in the first period, giving Chicago a 1-0 lead 5:18 in.
Before the game, Michigan Gov. Jennifer Granholm declared it "Steve Yzerman Day," more than a week after Yzerman's No. 19 jersey was retired.
Yzerman retired last summer after serving as captain for a league-record 20 seasons during his 22-season career, which was spent entirely with the Red Wings. He now works for the team as a vice president.
He led Detroit to Stanley Cup championships in 1997, 1998 and 2002, and ranks sixth in the NHL with 1,755 career points.