Rudi Garcia's men stormed to a two-goal lead through the attacker and Kevin Strootman, but an own goal and a Dries Mertens strike levelled the score before the Ivorian's winner
Roma's push for a 10th Coppa Italia title looked to be gathering pace when Gervinho and Kevin Strootman scored in the first half to set them on their way.
But an own goal from Giallorossi goalkeeper Morgan De Sanctis and substitute Dries Mertens' equaliser brought Napoli back into the contest.
Gervinho – Roma's top scorer this season – had the last laugh though, scoring with two minutes left to give his side the advantage heading into the return fixture.
Rudi Garcia's men's Serie A clash against Parma on Sunday was abandoned after just nine minutes due to a deluge of rain at Stadio Olimpico but the pitch held up on this occasion.
As a result, the hosts entered the match fresher than Napoli – who were stunned by Atalanta on Sunday, losing 3-0 – and after a slow start, Roma found their rhythm.
Gervinho scored from his side's first meaningful attack when he timed his run to perfection following an excellent ball from Francesco Totti.
The ex-Arsenal forward cut inside Anthony Reveillere and avoided Raul Albiol, showing great composure to dink the ball over the onrushing Napoli goalkeeper Pepe Reina before tapping into an empty net.
Napoli then failed to close down Totti and his fierce shot from distance stung the palms of Reina, while Reveillere limped off with an injury, to be replaced by Faouzi Ghoulam.
Roma continued to force the pace and they doubled their lead in stunning fashion, as Strootman took advantage of the free space before lashing a fierce 25-yard left-foot effort into the top corner in the 32nd minute.
Napoli had a penalty appeal turned down on the stroke of half-time as Christian Maggio failed to get a shot away under the attention of Vasilis Torosidis, but they did pull a goal back two minutes after the break.
Gonzalo Higuain's attempted cut-back deflected off Mehdi Benatia and was spilled onto the post, and then in, by former Napoli goalkeeper De Sanctis for an unfortunate own goal.
Adem Ljajic then forced Reina to tip behind before shooting wide twice, and the keeper also moved well to keep out a deflected Torosidis effort.
Roma were made to pay for their missed chances as Mertens levelled for Napoli with 20 minutes left.
Higuain had been fouled but the advantage was played, and Mertens skipped past Leandro Castan before lashing beyond De Sanctis with his right foot.
There was still time for more drama though, as Gervinho – who got the winner in the quarter-final against Juventus - finished a move that involved substitutes Mattia Destro and Alessandro Florenzi with a neat near-post finish.