With the AL hosts trailing 5-4 with two out in the bottom of the ninth at Briggs Stadium in Detroit, Williams hit a walk-off, three-run homer off the National League's Claude Passeau.
Trailing 2-1 going into the seventh, the NL had taken a 5-4 lead on a pair of two-run homers by shortstop Arky Vaughan of the Pittsburgh Pirates.
Vaughan's first homer in the seventh off Washington's Sid Hudson followed a leadoff single by Cardinals right fielder Enos Slaughter and put the NL ahead 3-2. An inning later, Vaughan homered with two outs off Eddie Smith of the Chicago White Sox, with Cardinals first baseman Johnny Mize on second with a double, to make it 5-2.
Vaughan was the first player to hit two homers in an All-Star Game. He finished the game 3-for-4 and drove in all but one of the NL's runs.
Passeau, of the Chicago Cubs, had entered the game in the bottom of the seventh and allowed a run in the eighth when Red Sox right fielder Dom DiMaggio singled with two out to drive in brother Joe after the Yankees center fielder doubled with one out.
Williams, who took a rare called third strike from Passeau during the eighth, almost didn't get the chance to be the hero in the ninth.
The winning rally started with one out when pinch-hitter Ken Keltner of the Indians and Yankees second baseman Joe Gordon hit back-to-back singles and Washington Senators third baseman Cecil Travis drew a walk to load the bases.
Joe DiMaggio then hit what appeared to be a sure, game-ending double-play grounder to Boston Braves shortstop Eddie Miller, who flipped to Brooklyn Dodgers second baseman Billy Herman to force Travis.
But Herman's wide relay to first pulled Reds first baseman Frank McCormick off the bag, allowing Keltner to score and keep the All-Star Game alive.
Up stepped Williams, who was hitting .405 on the season -- en route to .406 and the most recent .400 season in Major League history -- and had been 1-for-3 in his second All-Star Game.
Williams pulled a three-run homer to right.
Both starting pitchers departed with the game scoreless. AL starter Bob Feller of the Indians allowed one hit while striking out four in three innings. NL starter Whit Wyatt of the Dodgers allowed a walk in two hitless innings.
Williams and Cleveland shortstop Lou Boudreau each had two hits for the AL. Herman backed Vaughan with two hits for the NL.