Rakell carried the puck into the Kings zone and beat goalie Jonathan Quick with a high wrist shot from the right face-off circle to win it.
"I just saw there wasn't much time left," said Rakell, whose 32 goals are one shy of his NHL career high, set last season. "I just tried to build speed and beat somebody up the ice. Try to get the shot through. It was a great feeling."
\[WATCH: All Kings vs. Ducks highlights\]
The Ducks (40-25-13), who began the day holding the second wild card into the Stanley Cup Playoffs from the Western Conference, moved one point ahead of the St. Louis Blues for the first wild card.
Nick Ritchie scored, Ondrej Kase had two assists, and John Gibson made 28 saves for Anaheim, which is 6-1-1 in its past eight games and 15-2-2 in its past 19 at home.
"We showed some resiliency, but so did they," Ducks coach Randy Carlyle said. "This is typical L.A.-Anaheim game. It could've went either way. We were fortunate enough to find one in overtime."
Drew Doughty scored in the first period, and Quick made 31 saves for Los Angeles (43-28-8), which lost for the first time in three games.