I recommend reading this from Blessed Pope John II, which actually refers to
Unum Sanctum,
All Salvation Comes through Christ, General Audience, May 31, 1995:Since Christ brings about salvation through his Mystical Body, which is the Church, the way of salvation is connected essentially with the Church. The axiom
extra ecclesiam nulla salus"–“outside the Church there is no salvation”–stated by St. Cyprian (Epist. 73, 21; PL 1123 AB), belongs to the Christian tradition. It was included in the Fourth Lateran Council (DS 802), in the Bull
Unam Sanctam of Boniface VIII (DS 870) and the Council of Florence (
Decretum pro Jacobitis, DS 1351). The axiom means that for those who are not ignorant of the fact that the Church has been established as necessary by God through Jesus Christ, there is an obligation to enter the Church and remain in her in order to attain salvation (cf. LG 14). For those, however, who have not received the Gospel proclamation, as I wrote in the Encyclical
Redemptoris Missio, salvation is accessible in mysterious ways, inasmuch as divine grace is granted to them by virtue of Christ’s redeeming sacrifice, without external membership in the Church, but nonetheless always in relation to her (cf. RM 10). It is a mysterious relationship. It is mysterious for those who receive the grace, because they do not know the Church and sometimes even outwardly reject her. It is also mysterious in itself, because it is linked to the saving mystery of grace, which includes an essential reference to the Church the Savior founded.
In order to take effect, saving grace requires acceptance, cooperation, a yes to the divine gift. This acceptance is, at least implicitly, oriented to Christ and the Church. Thus it can also be said that
sine ecclesia nulla salus–“without the Church there is no salvation.” Belonging to the Church, the Mystical Body of Christ, however implicitly and indeed mysteriously, is an essential condition for salvation.
vatican.va/holy_father/john_paul_ii/audiences/alpha/data/aud19950531en.html