All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Interrupting the rows of prayer when there is a Sharee‘ah-approved interest, such as filling a gap in a front row, for performing Tawaaf (i.e. circumambulating the Ka‘bah) or Sa‘i (i.e. walking between Safa and Marwah mountains) is not blameworthy but is required. This is applicable to a man when he interrupts rows of men. A woman, however, is neither permitted to interrupt rows of men nor walk in between them. This is because a woman touching a non-Mahram man is prohibited under Sharee‘ah. When Allaah The Almighty Orders both men and women to lower their gazes from each other, then touching each other is even more prohibited. When a woman touches a non-Mahram man during the prayer, this does not invalidate the prayer unless he discharges pre-ejaculatory fluid or semen. In the latter case, the prayer is invalidated as it loses a prerequisite, which is purification. However, when there is a dire need, such as fearing death or severe harm due to over crowdedness, a woman is allowed to interrupt rows of men without incurring sin. In the latter case, her action falls under necessity. Allaah The Almighty Says (what means):
• {So fear Allaah as much as you are able.}[Quran 64: 16]
• {Allaah Does not Charge a soul except [with that within] its capacity.}[Quran 2: 286]