it is not valid for a woman to follow the imam and pray while she is outside the mosque; rather, she should pray on her own. Allah, the Exalted, knows best.
Question: If the house is near the mosque, or even adjoins it, is it permissible to follow the imam while remaining inside the house?
Answer: It is not permissible—even when the house is attached to the mosque—so long as the house itself is outside the mosque and she can neither see the imam nor the rows behind him.
Praying behind the imam from outside the mosque is allowed only in cases of necessity, such as when the mosque is overcrowded on Friday and some worshippers pray in the street while hearing the imam. In that circumstance, praying outside the mosque is permissible due to necessity.
As for this woman, no necessity applies to her; she is outside the mosque, and congregational prayer is not obligatory for her in any case.
***
A Woman’s Prayer in the Mosque
Question: When a woman goes out to pray the Tarawih in the mosque and her husband is displeased, telling her, “Pray at home; you will be more greatly rewarded,” what is the correct ruling? Please advise us—may Allah bless you.
Answer: First, it must be understood that whenever a woman goes out to the mosque—or anywhere else—she is required to observe proper modesty: she must not go out adorned or perfumed, but rather in concealing garments that are not clothing of adornment; she should wear no fragrance and must be careful to avoid anything that might tempt others or lead her to be tempted by them. This is the general code of conduct for a woman when she leaves her home, whether for the mosques or for anything else.