In the seventh, Shaw extended Milwaukee's lead to 3-0 by hitting a long home run to right-center field.
"First game at Miller Park, first time being here," said Shaw. "Great place to hit. Obviously, it's different than [the huge right field at] Fenway. I think it's going to be a very fun place to play."
The Brewers' other new corner infielder, first baseman Eric Thames, hit an RBI double and scored a run in the eighth.
Anderson worked around one walk and one hit -- a one-out single for Geovany Soto in the third inning -- in five scoreless frames, striking out six. His outing came one day after the Brewers announced the right-hander had won a spot in the starting rotation, and will pitch Thursday at home against the Rockies in the finale of a four-game series.
"It just felt good to be back out there [at Miller Park] and get up five times," said Anderson. "Hopefully we can carry that into the season. It was a good tuneup."
Infante struck out four batters in two innings and didn't allow a hit other than Shaw's single, but he walked three batters and took the loss. White Sox reliever Dan Jennings struck out four in two hitless innings, and closer David Robertson pitched a scoreless inning.
The White Sox avoided being shut out by scoring a pair of runs in the ninth. Nicky Delmonico, a former Brewers prospect, drove in the first run with a groundout before Danny Hayes hit an RBI double.
"We just tried to make sure we were as fundamentally sound as we could be leaving camp," White Sox manager Rick Renteria said. "We worked on a lot of the small things, making sure we caught the ball and did the things we needed to do. The guys brought a lot of energy, were focused and had fun."
White Sox Up Next: Derek Holland, who is scheduled to start Chicago's third game of the regular season against Detroit on April 6, will pitch against the Brewers in an exhibition game Saturday at 1:10 p.m. CT. Watch free on MLB.TV.
Brewers Up Next: Jimmy Nelson will be on the mound against the White Sox for the Brewers' spring finale on Saturday. Nelson spent the spring refining his split-changeup, and will tune up that pitch in advance of a regular-season debut on Friday against the Cubs at Miller Park. Watch free on MLB.TV.
Watch every out-of-market regular-season game live on MLB.TV.