As I understand Church teaching, the Roman Catholic Church is the Mystical Body of Christ.
As a body, it has a soul which animates it. The soul is the Holy Spirit and the gifts which he bestows.
Someone is an actual member of the body if and only if they (i) have received valid water baptism, (ii) profess belief in all Catholic truths [even if they’re ignorant of some], and (iii) are not separated from the Church by excommunication, heresy, schism or apostasy.
Someone is a member of the soul of the Church if and only if their soul is justified.
Any person who is a member of the soul belongs to the body of Christ, even if they’re not an actual member of this body. Only Roman Catholics are actual members, but not all Roman Catholics are justified.
All those folks who are members of the soul but aren’t actual members of the body nevertheless belong to the body in an important sense. These individuals include catechumens who are justified, and those invincibly ignorant people who are justified.
This is possible because the Church is not just the Church militant, i.e., the Roman Catholic Church. You also have the Church Triumphant (those in heaven) and the Church suffering, (those in purgatory). Therefore, the “Church” comprises these three aspects. So, someone can belong to the ‘Church’ in this broader sense while not being Roman Catholic.