The former LA Galaxy striker signed a six-month contract with Milan, whom he played for between 2010 and 2012, last month and was named as a substitute on Monday.
Ibrahimovic replaced Krzysztof Piatek for the final 35 minutes – 2,794 days since his last Serie A appearance on 13 May 2012 – but could not find a winner for the hosts.
The 38-year-old had two chances to break the deadlock but saw one header well saved by Sampdoria goalkeeper Emil Audero and another effort cleared off the line.
The Portugal captain pounced on a mistake from Ragnar Klavan to open the scoring just after half-time for the hosts.
The final act was left to Ronaldo, though, who slotted under the onrushing Robin Olsen to take his Serie A tally for the season to 13 in the closing stages.
Inter Milan maintained their place at the top of Serie A with Romelu Lukaku scoring twice in a 3-1 win at Napoli.
The former Manchester United forward netted two breakaway first-half goals to keep Antonio Conte’s side above Juve.
Lukaku ran 60 yards and fired home left-footed for his first in the 14th minute and was then thankful for a howler from Napoli keeper Alex Meret after 33 minutes.
Arkadiusz Milik pulled a goal back for the hosts six minutes later before Lautaro Martinez restored Inter’s two-goal advantage just after the hour mark.
Josip Ilicic scored twice as Atalanta kept up their pursuit for Champions League qualification with a 5-0 victory at home to Parma.
Riccardo Orsolini’s added-time equaliser rescued a 1-1 draw for Bologna at home to Fiorentina, who had led courtesy of Marco Benassi’s 27th-minute goal, while Rodrigo De Paul’s late winner earned Udinese a 1-0 victory at Lecce.