The Kings came from 2-0 down to force the extra period and Williams delivered in the fifth minute after a Dan Girardi turnover.
It meant the Kings, Stanley Cup champions in 2012, maintained home-ice advantage ahead of game two at the Staples Center on Saturday.
Henrik Lundqvist had kept the Rangers in the game and he finished with 40 saves, while Jonathan Quick stopped 25 shots.
Benoit Pouliot and Carl Hagelin had struck within two minutes of one another in the first period to give the Rangers a two-goal advantage.
But Kyle Clifford pulled a goal back and Drew Doughty levelled in the second period, after a Williams assist, to level at 2-2.
Williams was the hero for the Kings.
Girardi slipped and turned over the puck to Mike Richards, who played a simple pass to Williams to fire into the top corner of Lundqvist's net to give the Kings a deserved victory.