The win was the third in a row by Los Angeles over its Southern California rival and marked the first regulation loss by Anaheim in 11 games.
Rob Blake and O'Sullivan scored in a 1:32 span late in the second period to erase a one-goal deficit and give the Kings a 4-3 lead. Rookie Noah Clarke added a short-handed goal in the third period to secure the win for the Kings.
The three-point effort by O'Sullivan was his first multipoint game in the NHL. Kings goalie Mathieu Garon made 23 saves, including one on a penalty shot by Teemu Selanne, to pace the win. He replaced starter Sean Burke early in the first period.
"The energy we had for the rivalry seemed to feed us a little more tonight," Kings coach Marc Crawford said. "You can always tell how good a team is by how happy a team is to beat them, and we were very happy to beat them."
"We're left scratching our head for tonight, I can't think of this group playing as poor a game this year," said Ducks coach Randy Carlyle. "Obviously we didn't play to the level that was required, for whatever reason."
While the Ducks had moved within a win of matching Nashville for the most points in the league, the Kings have also played better lately. The Kings have climbed out of last place in the Western Conference with a 5-2-4 run in their past 11 games.
"We've been getting good goaltending and we are winning special team battles," defenseman Aaron Miller said. "We're working hard and we are working smarter."
Cammalleri got the Kings off to an early lead, but Moen and Penner scored on the Ducks' first two shots against Burke, leading to Garon replacing the veteran goalie.
The Kings tied the game on Cammalleri's second goal later in the first period.
"The rivalry is a good intense one, on a night like this when they're having such a great year and we're not, it's important that we were still able to battle," said Cammalleri, who leads the Kings in scoring with 71 points (31 goals, 40 assists).
Selanne gave the Ducks a 3-2 lead early in the second and had a chance to add to the lead on a penalty shot midway through the period, but Garon stuck out his right leg pad to stop Selanne.
Just under seven minutes later, Blake swiped in a rebound during a Kings' power play to even the score before Alexander Frolov made a nice spin move to set up O'Sullivan for a goal with 55 seconds to play in the period giving the Kings a 4-3 lead.
"It was a strange game and we weren't focused on what we are trying to do as a team," Ducks captain Scott Niedermayer said. "We never settled down to our game and they did."
Sunday's game was the eighth and final matchup between the teams this season. Each of the first seven games were decided by one goal, with four of the games going to overtime.
The Kings signed forward Raitis Ivanans to a one-year contract extension on Sunday ... The Ducks will play seven of their final nine games on the road ... Penner broke the Ducks' rookie scoring record with his first-period goal, which gave him 42 points on the season, one more than Chris Kunitz had last season ... Frolov's assist was the 200th point of his career.