Lorenzo Insigne sent the visitors into an eighth-minute lead at the Bernabeu, but goals from Karim Benzema, Toni Kroos and Casemiro ensured that Zinedine Zidane's side would take a two-goal lead into the second leg in Naples on March 7 as they bid to make the quarter-finals once again.
Zidane scrapped his 3-5-2 formation from the Osasuna clash at the weekend to revert to a standard 4-3-3, and James Rodriguez was the player chosen to start alongside Cristiano Ronaldo and Benzema in the final third. Gareth Bale, however, was not in the 18-man squad after only just returning from an ankle problem.
As for Napoli, centre-back Raul Albiol and attacker Jose Callejon both faced their former clubs, while Elseid Hysaj returned to the team after missing the Serie A clash with Genoa at the weekend, meaning that Christian Maggio dropped to the bench.
Real Madrid had a chance to take the lead inside the opening 20 seconds when Ronaldo set up Benzema - which was a feature of the first period - with a low cross inside the Napoli box, but the French striker could not beat Pepe Reina in the Napoli net.
There was hardly time to take a breath in the opening five minutes of action as Real Madrid continued to force the issue, but Napoli were a danger when they had the chance to counter through Callejon, Dries Mertens and Insigne.
Indeed, it was the visitors that made the breakthrough in the eighth minute when Insigne curled a long-range effort into the bottom corner after spotting that Keylor Navas was in a poor position.
Real Madrid had a chance to level in the 12th minute when Ronaldo again found Benzema inside the Napoli box, but the striker's header was away from goal as the visitors survived a dangerous moment.
Benzema missed two big chances in the early moments, but the Frenchman was not to be denied on the third occasion as he headed a searching Dani Carvajal cross into the back of the net to level the scores in the 18th minute, much to the relief of the home supporters.
Ronaldo had a glorious chance to send Real Madrid 2-1 ahead in the 28th minute after being played through by Luka Modric, but the number seven somehow blazed over the crossbar as Napoli survived another dangerous moment.
Marek Hamsik fired wide of Navas's goal in the 32nd minute as Napoli showed signs of life once again, before Benzema missed another excellent opportunity for Real Madrid after Ronaldo had shaped a cross into the Frenchman, who turned against the post under pressure from the advancing Reina.
Napoli started the second period on the front foot, but it was Real Madrid that scored the game's third goal in the 49th minute when Ronaldo dribbled towards the away side's box before picking out Kroos, who simply passed the ball into the bottom corner of the net.
Five minutes later, Real Madrid made it 3-1 on the night and it was a once-in-a-lifetime strike from Casemiro, who found the far corner of the net with a sensational volley from distance to put Napoli in all sorts of trouble.
Faouzi Ghoulam curled a free kick over Navas's crossbar just past the hour as Napoli looked to hit back, and the visitors were helped by some lacklustre defending from Zidane's team, who appeared to take their foot off the gas in the period that followed their third goal.
Casemiro tried his luck from distance once again in the 66th minute, but this time the Brazilian midfielder's effort was wide of the post, before Mertens curled one over the crossbar down the other end after a smart set-up from Callejon.
Mertens had another opportunity 20 minutes from time after a through-ball released the attacker into the Real Madrid box, but Navas was out to make a smart save as it remained 3-1 entering the final stages of the first leg in Madrid.
Reina was then called into action down the other end to keep out a low effort from James, who had been afforded far too much space inside the Napoli box once again.
Both managers made changes as the match entered its final 15 minutes, and it was Real Madrid that were searching for the game's next goal as Benzema and Ronaldo started to find each other in dangerous positions once again.
Callejon actually had the ball in the back of the Real Madrid net 10 minutes from time after converting from close range, but the former Los Blancos attacker was ruled offside. The end-to-end nature of the contest continued into the final five minutes and Marcelo missed a golden chance to slot one into the bottom corner after another unselfish Ronaldo pass.
Neither team could add to the four goals on the night, however, and Real Madrid will therefore take a two-goal advantage into the return match in Naples early next month.