Explicit joining with the Catholic Church is a necessity if the person has arrived at the knowledge of its necessity for salvation. Hence, the Sacred Council says:
“Whosoever, therefore, knowing that the Catholic Church was made necessary by Christ, would refuse to enter or to remain in it, could not be saved.” LG 14.
However, if a person has not arrived at this truth, then the Lord shall not hold this against them, but rather they will be judged on their attempt to live in accord with right action.
Hence, the council says:
“Those also can attain to salvation who through no fault of their own do not know the Gospel of Christ or His Church, yet sincerely seek God and moved by grace strive by their deeds to do His will as it is known to them through the dictates of conscience.” LG 16
-Do works come from faith or not?
Faith is a tricky word, because we can have explicit faith, or implicit faith. As such, the likes of Rahner can set forth the proposition of the ‘anonymous christian’. (not a very helpful term, try telling a muslim he is an anonymous Christian)
Either way, the council says:
" Nor does Divine Providence deny the helps necessary for salvation to those who, without blame on their part, have not yet arrived at an explicit knowledge of God and with His grace strive to live a good life." LG 16.
I’m pretty sure that the answers are yes and no respectively but I want to be sure.
The answer to the first question is a matter of knowledge. If the individual hasnt seen the church as necessary, they may be saved without having entered it.(Notwithstanding that salvation is full incorporation into the body of Christ)
The second is a bit trickier as it is open to a bit of interpretation. However, if I understand your question to be can a muclim do a good act? Certainly! Hence, without explicitly following Christ, they follow the dictates of their conscience, which is the aboriginal vicar of Christ.(cf. GS 16)