Rudi Garcia's men took all three points from the encounter, with the midfielder scoring two goals after the host had twice surrendered a lead to Roberto Mancini's side.A second-half Miralem Pjanic double sealed a 4-2 Serie A victory for Roma over a stubborn Inter on Sunday.
Having seen Juventus snatch a late 2-1 victory over Torino earlier in the day, the pressure was on Roma to produce a win at Stadio Olimpico.
Gervinho's 21st-minute opener was well-deserved after a bright start, but Andrea Ranocchia headed level 15 minutes later against the run of play.
The host's lead was re-established when Jose Holebas smashed home two minutes after the interval.
Inter refused to go down without a fight, though, and equalized again courtesy of a deflected Pablo Daniel Osvaldo strike 10 minutes later, but Pjanic proved to be the difference between the sides - netting twice before time was up to keep Roma within three points of league leaders Juve.
The away side, meanwhile, suffered its first defeat since Roberto Mancini - who was sent off after Roma's third goal - returned to the club, and has now slipped to 11th in the Italian top flight.
Rudi Garcia made two changes to the Roma side that played in the disappointing 1-1 Champions League draw against CSKA Moscow on Tuesday, bringing Pjanic and former Inter man Maicon in for Daniele De Rossi and Alessandro Florenzi, while Yann M'Vila, Rodrigo Palacio and Hugo Campagnaro came into the Inter side after its 2-1 win against Dnipro in the Europa League on Thursday.
Inter appeared content to sit back and make life as difficult as possible for Roma's attackers in the early stages, but Gervinho threatened to unlock its determined defense with a darting run down the right in the 19th minute.
That move eventually came to nothing, but the Ivorian made no mistake when he was served the ball on a plate by Adem Ljajic two minutes later - tapping home his second league goal of the season to break the deadlock.
Zdravko Kuzmanovic squandered an opportunity to give the visitor an almost-instant reply when Morgan De Sanctis got down brilliantly to his left to tip the Serbia international's shot around the post, before Gervinho had the ball in the back of the net again, only to see the goal ruled out for offside.
Having dealt with Inter's first shot on target superbly, De Sanctis was helpless as Ranocchia rose highest at a 36th-minute corner to head in the first goal the Giallorossi have conceded at home in Serie A this season.
Roma emerged for the second half determined to re-claim the advantage and had to wait just two minutes to do exactly that - Holebas beating two defenders as he burst his into the box to blast an effort into the top right corner.
Osvaldo's overhead kick at the other end was an optimistic, and ultimately unsuccessful, bid to restore parity, but fortune favored the brave and the Argentina-born striker's next shot at goal deflected beyond De Sanctis off Davide Astori.
Radja Nainggolan saw a low drive well saved soon after, and Roma went in front for a third time when the ball fell kindly for Pjanic in the center of the penalty area, with the Bosnian stroking home with ease, although Mancini's side felt it should have been awarded a free kick in the build up.
The Nerazzurri pressed for yet another leveler after boss Mancini had been banished from the bench for his earlier protestations, but a 25-yard curling free-kick from Pjanic in stoppage time ended any lingering hopes of forcing a result.