Williams missed four of his first five shot attempts but warmed up after halftime, going 7 for 8 and making all four of his 3-pointers. It marked just the second time this season that Williams broke the 20-point barrier.
David Lee added 10 points and 11 rebounds for the Warriors (9-16), who won for only the third time in their last 17 games.
Darko Milicic had a career-high 25 points and 11 rebounds for Minnesota (6-19).
Golden State was playing its third straight game without guard Stephen Curry, who rolled his right ankle in a 111-94 loss to San Antonio on Dec. 8.
Williams, a late-season addition from the NBA's Development League, picked up the slack. He scored 10 points in the third quarter then added 12 in the fourth when the Warriors broke open a tight game and pulled away.
Minnesota, which led by as much as 11 in the first half, was at 94-88 with five minutes left before a 9-2 run by Golden State sealed the win. Ellis had six points and Williams added three during the spurt, including a soaring one-handed dunk.
Ellis played all 48 minutes and went 13 of 24 while adding six assists. It's the fifth time this season Ellis has had 30 points or more.
Dorell Wright added 12 points and five rebounds for the Warriors, who have won five straight against Minnesota. Golden State beat the Timberwolves 104-94 on Nov. 27.