Though communion (as well as anointing of the sick and confession) is ordinarily reserved exclusively for Catholics, in rare circumstances, the eucharist, anointing of the sick and confession may be administered to baptized non-Catholics.
In the Code of Canon Law, it states:
Can. 844 §1. Catholic ministers administer the sacraments licitly to Catholic members of the Christian faithful alone…without prejudice to the prescripts of §2, 3, and 4 of this canon, and Can. 861, §2.
For our purposes it will suffice to look at §4 of Can. 844:
§4. If the danger of death is present or if, in the judgment of the diocesan bishop or conference of bishops, some other grave necessity urges it, Catholic ministers administer these same sacraments licitly also to other Christians not having full communion with the Catholic Church, who cannot approach a minister of their own community and who seek such on their own accord, provided that they manifest Catholic faith in respect to these sacraments and are properly disposed.