The Italian side produced an immense display in the first half and took the game to the defending European champions, deservedly going ahead through the in-form Dries Mertens, who also hit the post.
But Madrid fought back early in the second half through two Sergio Ramos headers, the second of which took a hefty deflection off Mertens, before sealing the 6-2 aggregate win in stoppage time through Alvaro Morata.
Sarri saw plenty of reasons to be optimistic, though.
"We get the feeling we are not that far off [the top clubs]," Sarri told Mediaset Premium. "We dominated the best team in the world for 55 minutes.
"If we can grow, become more physical, then we can become competitive at this level too.
"It's a young squad, it has a bright future ahead of it. That final step is the hardest, but I get the feeling we can do it.
"Real Madrid are a very strong side; you need a lot of luck to keep the tie open and a bit of luck on the post to put us 2-0 up would have given us more fuel.
"It would have been tough anyway against the reigning champions of Europe and the world, but dominating them for 55 minutes gives us hope for the future."
Captain Marek Hamsik also refused to dwell on the negatives, insisting Napoli can be proud of their efforts in this season's competition.
"We leave the Champions League with heads held high," the Slovakian said. "In the first half we proved that we can play it out with one of the best teams in the world.
"It's a shame that we conceded the goals on set plays. We can fight it out with the biggest clubs and that is a starting point.
"One thing is for sure – we need to improve on corners."