Hellickson (6-5) held Milwaukee to two runs, four hits and a walk in five innings, posting his first victory since May 19.
The Phillies' bullpen backed him up, working four scoreless innings, including another scoreless effort from Pat Neshek, who has held opponents without an earned run in 39 of his 40 outings this season, including his last five in a row.
Williams and Odubel Herrera had two hits each for the Phillies, who finished with 10 for the day.
Only three of those hits were given up by Brewers starter Matt Garza, who worked five innings and held the Phillies to a run with three walks and a strikeout.
Garza walked two batters with two outs in the first inning but got out of the jam unscathed when Andrew Knapp bounced out to second.
Philadelphia got on the board in the fifth when Herrera drove in Ty Kelly with a ground-rule double down the right-field line.
Orlando Arcia reached on a two-out single in the bottom of the inning and manager Craig Counsell opted to pinch-hit for Garza. The move paid off as Brett Phillips launched his first career home run to right, putting the Brewers ahead 2-1.
But the lead didn't last long.
Rob Scahill (1-3) came on to work the sixth and gave up three straight singles before giving way to left-hander Tyler Webb, acquired during the All-Star break from the New York Yankees.
Webb threw just one pitch -- a curveball over the plate -- to Williams, who sent it to center for his second home run of the season and first career grand slam, giving Philadelphia a 5-2 lead.
Milwaukee brought the tying run to the plate in the eighth but came up empty. The Brewers threatened again in the ninth as Hector Neris allowed the first two batters to reach before he retired the next three in a row for his eighth save.
NOTES: With OF Aaron Altherr sidelined for a second straight game with a strained right hamstring, Phillies manager Pete Mackanin moved CF Odubel Herrera into the leadoff spot. ... Phillies RHP Pat Neshek worked a scoreless seventh inning. Neshek, a likely trade candidate as the deadline nears, has not allowed a run in his last five appearances and in 39 of his 40 outings this season ... Milwaukee's loss, paired with a third consecutive victory by the Chicago Cubs on Sunday, trimmed the Brewers' lead over the National League Central to 4 1/2 games.