Carlos Vela opened the scoring with a stunning strike on five minutes before doubling the visitors' advantage on 26 minutes.
LAFC was in complete control of the very first Los Angeles derby - El Traffico - after Daniel Steres turned into his own net three minutes after half-time.
Sebastien Lletget and Chris Pontius pulled goals back for the Galaxy after the hour mark to set up a grandstand finish and the rest, as they say in show business, is history.
Ibrahimović fired home, on the half-volley, from 40-yards out to level the game before heading home in additional time to hand his new team victory.
Bob Bradley's side won their opening two games of the new season going into the game with their new rivals and found themselves ahead early in the game.
Vela strikes twice in first-half
Emmanuel Boateng was dispossessed by Steve Beitashour near his own penalty area and the ball arrived at the feet of Vela, who cut back inside and curled delightfully across into the top corner.
Ashley Cole helped a long ball over the top back towards Boateng on 13 minutes, but the midfielder struck just over the crossbar.
With the next opening of the game, the visitors doubled their lead. A quick break out from their own penalty area saw Marco Ureña through down the right side.
The ball was played into the path of Diego Rossi and then over the Vela, who took the ball away from the sprawling 'keeper before curling home off the underside of the crossbar.
LAFC could've been further ahead before half-time, but Ureña was denied by the legs of David Bingham and then Rossi curled wide of the post.
However, after the break the visitors did manage to find a third goal in the game after Ureña's low cross was turned into his own net by Steres at the near post.
Galaxy pull a goal back through Lletget
Pontius threatened to pull a goal back on 58 minutes, but the Galaxy did manage to get on the scoresheet three minutes later.
LAFC lost the ball poorly at the back, Servando Carrasco stealing the ball off Benny Feilhaber before Lletget curled into the net with a first-time effort.
The hosts sprung to life thereafter, and the crowd was calling for Ibrahimović to enter the fray. That he did, the Sweden international come onto the pitch on 71 minutes.
LA Galaxy pulled a further goal back two minutes later as Boateng was allowed time and space to dig out a cross from the left and Pontius headed powerfully past Tyler Miller.
Three minutes later, Ibrahimović produced one of the goals of the century as the Swede hammered home, over the 'keeper, on the half-volley from around 40-yards out.
Ibrahimović inspires the remarkable comeback
The hosts were saved by the woodwork on 86 minutes though as Rossi's through ball found Ureña, who fired low off the post.
A further chance fell LAFC's way, but again, they failed to take it. Ureña found Eduard Atuesta, who turned and struck across goal and inches wide of the far post.
The scene was set for one man though and he certainly made a statement in his first MLS game for the LA Galaxy.
Baggio Husidic's cross floated into the LAFC penalty area and Ibrahimović got to the cross ahead of the approaching 'keeper and headed home to spark jubilant celebrations.
The Galaxy produced one of the best comebacks in MLS history and managed to hold out to pick up the first victory over their new rivals.