Detroit (3-1-2) also got a goal and an assist from Pavel Datsyuk and goals by Mikael Samuelsson and Dan Cleary. Tomas Holmstrom had three assists, and Niklas Kronwall added two helpers.
Cleary's goal 9:42 into the third period broke a 3-3 tie, and Williams' second goal, on a power play, clinched it 5-3 with 4:42 left to play.
Pascal Dupuis, Pierre-Marc Bouchard and Mikko Koivu got the goals for the Wild (2-2), and Brian Rolston had two assists.
Dupuis opened the scoring for the Wild 7:21 into the first period.
Williams scored for Detroit early in the second period, but Bouchard's 5-on-3 power-play goal restored Minnesota's lead.
Samuelsson's goal tied the score at 2-all just 1:16 into the third period.
Koivu's power-play goal at 8:13 of the third period gave Minnesota a 3-2 lead, but Datsyuk tied the contest just 38 seconds later.
Dominik Hasek had 21 saves for Detroit, and Manny Fernandez stopped 35 shots for Minnesota.