Ospina is on loan from Premier League side Arsenal but the Colombia international revealed a move to South America could be a "possibility" after the return of Alex Meret, though he was in the XI for Sunday's goalless draw against Torino.
The 30-year-old Ospina has made 11 Serie A appearances this term since arriving on a season-long loan deal, which includes a clause for a permanent transfer depending on the number of games played.
Discussing Ospina post-match, Ancelotti told reporters: "Ospina was meant to play on Thursday in the Europa League, but wasn't feeling up to it, so I switched things around and used him [against Torino] instead.
"Ospina will remain at Napoli next season, regardless of how many games he plays."
Napoli signed Ospina on loan at the start of the season after Meret broke his arm just six days following his €22 million (£19m/$25m) arrival from Udinese.
Ospina is third in the pecking order at Arsenal, where Bernd Leno has established himself as the Gunners' first choice ahead of Petr Cech, who will retire at the end of the campaign.
It was a frustrating outing for Ancelotti's Napoli against Torino, who managed to hold on for a share of the spoils.
Napoli attempted 26 shots without finding the back of the net as they slipped 13 points behind Serie A leaders and reigning champions Juventus.
"From what we see on the pitch, from a mental point of view, the team looks very motivated, very focused," Ancelotti said. "We play very well, but we are not able to score the goals that we should score. In a match like this you are supposed to win for the way you performed. But if we didn't win, we can't put the blame on anyone else but ourselves, because in two matches [against Fiorentina and Torino] we had 18 chances and we didn't score a single goal."
Ancelotti added: "It is a bit funny the fact that we find ourselves here complaining about a draw when the team performed very well. The team performed well in Florence, they did very well tonight. We should have had six points [from these two matches], we only have two instead. We can't say that we were unlucky. No, it's our fault and our fault only. And that's it."