With Milan having gone three straight games without scoring, the 38-year-old netted the decisive second goal with an excellent finish after 64 minutes.
The visitors had moved ahead on Saturday through Rafael Leao's deflected effort, his first goal since September, which arrived just 32 seconds after the restart.
Cagliari remain sixth in the table but have lost four straight Serie A matches and are on their worst run since October 2017.
The only chance in a quiet first half hour was Theo Hernandez's shot from a tight angle that was saved by the legs of Robin Olsen.
Milan almost broke through when Ibrahimovic's header was touched onto the upright by Olsen and they came close again from the resulting corner, which was flicked on by Alessio Romagnoli to a stretching Leao, who could not convert at the far post.
Cagliari rarely threatened but an audacious Nahitan Nandez lob from the right touchline had to be saved by a back-tracking Gianluigi Donnarumma.
Milan made an ideal start to the second half when Samu Castillejo's lofted pass found Leao, who controlled neatly before seeing his shot deflect off defender Fabio Pisacane and loop in over a helpless Olsen.
Midway through the half, Ibrahimovic sealed victory as he swept a first-time, left-footed effort into the far corner from 12 yards after latching on to Hernandez's delivery from the left.
Ibrahimovic thought he had a second late on but was denied by an offside flag having headed in a cross from Ismael Bennacer, Donnarumma not having a save to make in the closing stages as Milan held on comfortably.
What does it mean? Ibra gives Milan much needed boost
Coming into the game, Milan were on their lowest Serie A goal total after playing 18 games since 1985.
Enter Ibrahimovic, whose fine finish sealed victory after he went the closest of anyone to scoring in a quiet first half. His return and Milan's seventh top-flight win of the season gives them something to build on in the second half of the season.
Castillejo creativity boosts Milan
Castillejo was handed a rare start and made the most of it, setting up Leao's opener and finishing with three chances created, level with Hakan Calhanoglu for the best on the pitch.
Simeone struggles for hosts
Ahead of the match, Giovanni Simeone revealed he used to wear an Ibrahimovic shirt when he grew up as a Milan fan, but the striker could not match the former Sweden international on the pitch, substituted after 69 minutes having struggled to make an impact.
Milan have the chance to continue their momentum when they host a poor SPAL side in the last 16 of the Coppa Italia on Wednesday, a day after Cagliari have a challenging trip to Inter in the same competition.