Roma s Chris Smalling celebrates after scoring his side s 2nd goal during a Serie A soccer match between Inter Milan and Roma at the San Siro stadium in Milan, Italy, Saturday, Oct.1, 2022 (AP)
England defender Smalling perfectly met Lorenzo Pellegrini's free-kick with 15 minutes remaining to complete Roma's comeback from going behind to Federico Dimarco's fine first-half strike.
Jose Mourinho's side, who levelled through Paulo Dybala six minutes before half-time, are four points behind Napoli in fourth place after a win which also leaves Inter further back in the title race.
Simone Inzaghi's seventh-placed team are eight points off the pace after losing for the fourth time in their eight matches, hardly the best preparation for the crucial Champions League visit of Barcelona on Tuesday.
Inter started strongly and were effectively camped in Roma's half for most of the first half, the away side not able to do anything more than sit back and try to hold off waves of attack.
The hosts thought they had taken the lead with 10 minutes gone, Edin Dzeko punishing dreadful defending from his former team by spinning and hitting a low shot past Rui Patricio.
However the Bosnian had strayed offside in the build up and Inter had to wait until the half-hour mark for the goal their play deserved.
Inter academy product Dimarco followed up on his goal against Hungary which helped put Italy in the Nations League final four by sweeping home Nicolo Barella's nicely-weighted pass.
The hosts looked heavy favourites for the three points but the goal woke Roma, who were level nine minutes later.
Starting up front in place of Tammy Abraham, Dybala had just been denied by a Samir Handanovic double save which also kept out Leonardo Spinazzola when he thrashed in his brilliant leveller from the Italy left-back's deep cross.
The Argentina forward was replaced by Abraham just before the hour and Inter responded, Hakan Calhanoglu hitting a free-kick off the bar before Kristjan Asllani, stepping in for Marcelo Brozovic, flashed a curling effort just wide.
However Roma settled and Smalling tipped the result in the away side's favour with his second of the season to give Mourinho a precious win against his old club.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)