Hagi put Rangers on course to exorcise their derby demons with a long-range blast early in the first half at Ibrox.
Robin Propper struck after the interval and Danilo wrapped up a first victory against Celtic in seven attempts for Rangers boss Philippe Clement.
The only dark cloud on a memorable day for Rangers was the sight of Celtic midfielder Arne Engels being struck by a missile thrown from the crowd in the closing minutes.
Beaten for the first time in the league this season, champions Celtic still hold an 11-point lead over second-placed Rangers.
While Rangers remain unlikely to catch their hated neighbours, this was a cathartic win after a 3-0 loss at Celtic in September and a League Cup final penalty shoot-out defeat against Brendan Rodgers' team in December.
Those results were part of a miserable run for Rangers in the Glasgow derby and their first win over Celtic since May 2023 was only their second success in the last 15 meetings.
After their Boxing Day defeat at St Mirren and a tepid draw with Motherwell, Rangers' second win in six games eased a little of the pressure on under-fire boss Clement.
Celtic's first defeat in 19 games in all competitions, since losing 7-1 at Borussia Dortmund in the Champions League, was a painful start to 2025.
It is only the second time they have lost their opening league game of a calendar year in the last 27 years.
Rodgers had insisted Celtic would "not soften up" because of their huge lead in the title race.
But the Hoops were unusually lethargic from the moment Hagi caught them flat-footed to give Rangers the lead in the seventh minute.
Nico Raskin drove forward with intent and slipped a clever pass to Hagi, who unleashed a low drive from 25 yards that appeared to take Kasper Schmeichel by surprise as it flashed past the slow-to-react Celtic keeper.
Knockout blow
Hagi's first league goal for Rangers since May 2023 was one his father Gheorghe Hagi - who played for Real Madrid and Barcelona in the 1990s - would have been proud of as he watched from the Ibrox stands.
Clement's team were inches away from doubling their lead moments later as Vaclav Cerny's deflected strike slammed against the bar from the edge of the area.
Rangers were without skipper James Tavernier, keeper Jack Butland and defenders John Souttar and Leon Balogun due to a variety of fitness issues.
Ignoring those absences, Rangers produced their best performance of the season.
Despite being out-played for long periods, Celtic nearly equalised with their only shot on target in the first half when Reo Hatate's rocket forced a fine save from Liam Kelly.
Rangers were unfazed and Cerny drilled against the far post in the second half, then had a header saved by Schmeichel before the hosts finally delivered the knockout blow in the 66th minute.
Raskin rose to meet a corner and his header was pushed out by Schmeichel to Propper, who slid in to convert from close range.
Danilo kept the New Year party in full swing for Rangers' jubilant fans in the 81st minute as he slotted home from close range with his first touch after coming off the bench.