However, the Nerazzurri turned things around immediately after the break with a strike from Marcus Thuram, who also forced an own goal from new Roma defender Angelino.
The Bianconeri can cut the gap to four points with a win at home to relegation-threatened Udinese on Monday, but will then have played a match more than Inter.
Roma remained a point behind fourth-placed Atalanta after De Rossi's first loss. The former Roma player had won all three of his matches as coach after replacing the fired Jose Mourinho.
The Nerazzurri were without coach Simone Inzaghi on the bench in Rome after he picked up his fifth yellow card of the season in last weekend's win over Juventus.
The suspended Inzaghi watched from the stands as his team took the lead in the 17th minute with the help of a former Inter player.
Former Nerazzurri forward Romelu Lukaku headed away an Inter corner, but only as far as Acerbi, who headed it into the back of the net.
Roma levelled in the 28th minute when a free kick was floated over the top and Mancini headed it into the bottom right corner from close range.
Roma turned the match around on the stroke of half-time when a counterattack sent El Shaarawy sprinting into the area and he unleashed a shot that hit the crossbar and the left post before also bouncing off the right post and going in.
But Inter took control right at the start of the second half.
Thuram toe-poked home Matteo Darmian's cross four minutes after the break and appeared to have fired Inter ahead with an almost identical goal seven minutes later - this time from Henrikh Mkhitaryan's cross - but it was Angelino who got the final touch.
Benjamin Pavard also hit the post for Inter before Bastoni's late goal, his first in more than two years.
Lazio moved to within two points of Atalanta, who visit Genoa on Sunday.
It was Cagliari's fourth straight loss and left Claudio Ranieri's team in penultimate position, albeit only a point from safety.
Lazio took the lead in Sardinia thanks to a comical own-goal in the 26th minute as two Cagliari players got into a tangle when trying to deal with a Gustav Isaksen ball across the six-yard box and Paulo Azzi's attempted clearance ricocheted in off Alessandro Deiola's shin.
Immobile doubled Lazio's lead shortly after the break when he tapped in a rebound after Cagliari goalkeeper Simone Scuffet could only parry Isaksen's strike.