(Acts 2:38-39) Peter replied, "Repent and be baptized, every one of you, in the name of Jesus Christ for the forgiveness of your sins. And you will receive the gift of the Holy Spirit. The promise is for you and your children and for all who are far off - for all whom the Lord our God will call.”
We can see that baptism indicates a further, permanent, indwelling of the Holy Spirit. It’s for “all whom the Lord our God will call ” So the first step is being called by God and having faith, next comes baptism.
Also, (Mark 16:16) Whoever believes and is baptized will be saved; whoever does not believe will be condemned.
(Ezekiel 25-28) I will sprinkle clean water on you, and you will be clean; I will cleanse you from all your impurities and from all your idols. I will give you a new heart and put a new spirit in you; I will remove from you your heart of stone and give you a heart of flesh. And I will put my Spirit in you and move you to follow my decrees and be careful to keep my laws. Then you will live in the land I gave your ancestors; you will be my people, and I will be your God.
All of these amazing promises are listed after baptism in Ezekiel. God is not confined to the sacraments (Catechism of the Catholic Church 1257) (and Cornelius received the Holy Spirit before baptism in the New Testament) so no it’s not necessary if you cannot get baptized for whatever reason. But no reason not to since it is commanded many times scripturally (and is a sacrament of the Catholic Church.)