The Nerazzurri faithful waved goodbye to their Argentine hero and celebrated keeping their hopes of European qualification alive heading into the final week
Both sides came into the clash needing points in their quests for European qualification, but all the attention was on the most decorated player in Inter's history.
The 40-year-old, who is Argentina's most-capped player with 145 appearances, has lifted 16 trophies with the club since joining from Banfield in 1995, but his 857th outing for the club had to wait until the second half.
Initially the hosts appeared to be in trouble as Giuseppe Biava put Lazio ahead in the second minute, but Inter battled back and went into the break 3-1 up thanks to two goals from Palacio and Mauro Icardi's strike.
Zanetti was introduced to much fanfare just after the break and although Lazio crafted numerous opportunities in the second period, Hernanes sealed the result against his former club with a stunning effort from range.
Victory means Inter is all but guaranteed a spot in the Europa League, with defeat for Lazio ending its hopes of a top-six finish.
With an expectant home crowd displaying banners of thanks for Zanetti, coach Walter Mazzarri was greeted with a frosty reception from the home faithful as word of the Argentinian's absence from the XI spread.
And things got even worse for him in just the second minute as Lorik Cana headed Bruno Pereirinha's free kick back across goal for Biava to prod in.
Lazio barely held the lead for five minutes, however, as Palacio raced on to Mateo Kovacic's defense-splitting through ball and deftly poked a clever finish past Etrit Berisha.
Proceedings quietened down after a frantic start, but Kovacic produced another moment of magic in the 34th minute, delivering a delightful outside-of-the-foot pass to Icardi, who coolly slotted home from inside the area.
And Inter doubled its advantage just three minutes later when Yuto Nagatomo's left-wing cross evaded the Lazio defense, allowing Palacio to stroke the ball beyond Berisha's reach.
The second half endured a muted start as the inevitable arrival of Zanetti was anticipated. Mazzarri finally unleashed his captain in the 52nd minute, drawing a vociferous ovation from the crowd.
However, Lazio was in no mood to stand around and appreciate the retiring midfielder as Samir Handanovic denied Biava a second with an acrobatic save to his right, before Balde Keita inexcusably sliced a half-volley well over the crossbar from 14 yards.
The visitors' pressure continued into the final stages, but any threat of an unlikely comeback was thwarted with 11 minutes to go as Hernanes rifled in an unstoppable left-footed effort from 20 yards.
Zanetti was the game's final focus as he consoled a supporter who had run onto the pitch and approached him - an act met with applause from all sides of San Siro as the emotional fan was escorted from the field.