A 24th minute goal from Dries Mertens had Napoli dreaming of a triumphant comeback, but a powerful Ramos header in the 57th minute drew the defending champions level on the night.
The Andalusian then saw another header deflected into the net by Mertens, with substitute Alvaro Morata scoring late on to seal a 3-1 victory and 6-2 aggregate result.
"A week ago, the critics were killing me so I'm not going to claim to be a hero now after scoring these goals," Ramos said to reporters after the final whistle.
"But what better way for me to celebrate 100 matches [in Europe] than by scoring?"
The club captain admitted that his team was under the cosh in the early stages of the game.
"We suffered a lot in the first half," he said.
"If we knew the formula to always play well, things would be very easy.
"Things don't always go to plan but when the attitude is good, everything else follows."
"I'll be happier if Barcelona lose, I'll sleep more easily."
Zidane: Real Madrid's performance? We won and that's that
After Los Blancos staged yet another comeback victory against Napoli, coach Zinedine Zidane admitted that his charges were poor in the first half, but reiterated that the victory and qualification for the next stage is what matters.
Trailing by a two goal deficit from the first leg, Napoli took the game to Real in the first half and were rewarded after Dries Mertens slotted home in the 24th minute to finish off a fine team move.
But the indomitable Sergio Ramos equalized with a 57th minute header, before seeing a second header deflected into Pepe Reina's goal by Mertens, and Alvaro Morata's late strike sealed another 3-1 win for the defending champions against the Italian side.
"We won 3-1 and that's what counts," Zidane told reporters after the game.
"Real Madrid suffered in the first half, especially early on because we didn't do what we set out to do and this is a difficult stadium to play in.
"They put a lot of pressure on us and stole a lot of balls from us, but the second half was different because we played more in their half of the pitch," he said.
The Frenchman revealed that there was no secret behind his half-time team talk.
"The discussion was that we had to change something because they were giving us difficulties," the 44-year-old said.
"We talked about playing higher up the pitch and joining the lines better," he continued.
"But we knew we had chances to score in the first half, and we're thankful that Sergio [Ramos] stuck his head in to push us to victory.
"Corners and set-pieces are also a part of football, as is the fact that a game lasts for 90 minutes," he maintained.
Asked about whether Gareth Bale was lacking in work rate, the French boss refused to single out the Welshman or any other player for his unfortunate difficult start.
"I don't agree that Bale didn't help on the defensive side, because all the players struggled to get into the game," he concluded.
Emery: PSG's confidence remains intact
Adifficult trip to the Camp Nou awaits Unai Emery and his Paris Saint-Germain squad, and the coach has emphasized the need to respect their opponents and the scenario itself to avoid what would be a historic comeback from the Catalans.
Not happy to sit back and soak up pressure, the Parisians will play on the front foot and look to control the session and therefore the game.
"Our confidence in ourselves remains intact," Emery said in his pre-match press conference. "We know it is a very important match and we are all in this together.
"The confidenece I have in my squad is the same as it was after the first leg in Paris, and we seek to play with a lot of personality, continue what we did in the first leg, and not think of the result."
In these cases, where each squad are emotionally speaking can always end up tilting the tie in unexpected ways.
"The bigger the occasion, the more important any overall emotional management is," Emery continued. "All of my players are prepared to face Barcelona in a great stadium."
As to the possibility and talk of a Blaugrana comeback, the Spaniard remains wary and attentive at the possibility.
"If there is anything I have learned over the years, one must always have respect," the coach stated. "Barcelona are a great team but this is a chance for PSG to take one more step."
The opponent may well play a different formation than in the first leg, as Luis Enrique has experimented with a 3-4-3 whenever his side are in possession to help fix a predictable build-up.
So, Emery has had to keep that in mind as well, as he draws up his specific plan.
"Leaving aside the system and players selected, Barcelona are a great team with great players," he pointed out. "They have a lot of alternatives and also what they are capable of due to individual quality.
"We'll have to work on the individual battles against them."
Finally, the PSG boss was happy to discuss his squad's fitness heading into the key match, and mentioned three players in particular.
"Thiago Silva is our captain and is a very important player for us," Emery concluded. "He is very involved and I am happy with him.
"Verratti too is very happy and he transmits that.
"Cavani is giving a little bit extra but this is an opportunity for all of us to take another step. In football, all that matters is the present."
Luis Enrique: If PSG scored four, Barcelona could score six
Barcelona's hot scoring form of late has Luis Enrique confident that his side can not only knock out Paris Saint-Germain from the Champions League on Wednesday night, that they can do so with goals to spare.
Recent routs over Celta Vigo and Sporting Gijon have boosted the Catalans' morale and their optimism is high going into the return leg of the last-16 tie, despite their 4-0 deficit.
"We are in the middle of the tie, we have nothing to lose and a lot to win - if they scored four, we can score six," the Asturian told the press on Tuesday afternoon. "We arrive in good shape and we have to be confident.
"Without a doubt, we have to be patient as the result of the first leg was very clear, but we are only halfway through.
"We have to do a lot of things throughout the game and assert our dominance in attack and defense because PSG are a difficult team and will make things hard for us."
With Unai Emery naming a large travel party of players to travel from the French capital, the Barcelona boss was similarly keen to keep his cards close to his chest regarding team selection.
"Any of the 20 players I have at my disposal could play together," he said.
"We can play with many systems and I don't want to give any hints to Emery.
"Everyone has to be professional and know that sport puts you in situations of all kinds. If this team doesn't need a comeback like this so far, it's because we've been generally very good in our first legs."
A boisterous Camp Nou will greet the two sides on Wednesday night and Luis Enrique is hoping for constant backing from home fans, even if the tie goes to penalties.
"Every football game needs good emotional management, but this one even more," said the coach. "The players should be calm but not the fans.
"The Camp Nou must be a pressure cooker from 20 minutes before kick off, we need the supporters to be hyper alert and hyper excited.
"Marc-Andre [ter Stegen] does not need to hear about [penalties], he knows that all he has to do is stop them from scoring. Our players will know in themselves if they are more or less prepared to take a spot- kick. "