In Hebrew, a fulfilled prophecy requires fulfillment through a pattern. To the Western (Greek) mind, which looks simply at prophecy and fulfillment, any fulfillment is acceptable. In Hebrew, failure to follow the pattern is essentially an unfulfilled prophecy.
That Jesus' death by crucifixion fulfilled the prophecy and the pattern described in Zechariah is one of the central aspects to fulfillment of that Scripture as God's plan of redemption of all creation1:
But one of the soldiers pierced His side with a spear, and immediately blood and water came out. And he who has seen has testified, and his testimony is true; and he knows that he is telling the truth, so that you may believe. For these things were done that the Scripture should be fulfilled, “Not one of His bones shall be broken.” And again another Scripture says, “They shall look on Him whom they pierced.” (John 19:34-37)
The fulfillment of Zechariah is a key Old Testament prophecy to how God would bring about redemption and ultimately recreation.
The crucifixion of Jesus took place during the time of Passover which is an annual reminder of what occurred in Egypt:
And they shall take some of the blood and put it on the two doorposts and on the lintel of the houses where they eat it. (Exodus 12:7)
Individual families mourning separately are a key component in Zechariah 12:12-14. This follows the pattern of The First Passover where each family entered their house and ate.
Zechariah adds the element of men and women being separated. This is not how The First Passover was observed. It is possible that customs may have changed so that men and women ate separately during the time of the crucifixion. However, the New Testament is clear that Jesus and His disciples ate the Passover meal before His crucifixion.2 So while the time of Passover and separation by family is central to the understanding Zechariah, the Passover meal is not part of this pattern.
After the crucifixion, the New Testament states the men disciples went to their own homes separate from Mary, which shows that at least some of the women disciples were staying in separate houses:
Then the other disciple, who came to the tomb first, went in also; and he saw and believed. For as yet they did not know the Scripture, that He must rise again from the dead. Then the disciples went away again to their own homes. (John 20:8-10)
Zechariah’s prophecy ends describing events which followed the crucifixion: this is the essence of the prophecy. The disciples went to their own homes and mourned. The House of David would be His family members. They had traveled from Galilee to Jerusalem and would have temporary living arrangements, men with men and women with women.
His mother, who was not of the House of David, did not stay with His brothers or sister(s):
Now there stood by the cross of Jesus His mother, and His mother’s sister, Mary the wife of Clopas, and Mary Magdalene. When Jesus therefore saw His mother, and the disciple whom He loved standing by, He said to His mother, “Woman, behold your son!” Then He said to the disciple, “Behold your mother!” And from that hour that disciple took her to his own home. (John 19:25-27)
Thus one of His final acts on the cross was to ensure His mother stayed in a different house so that Zechariah would be accurately fulfilled. In doing so He indicates He was aware of the significance of Zechariah and thinking clearly at that time.
The period of mourning which extended to and past the resurrection fell during the Feast of Unleavened Bread. Thus in terms of the Passover in Egypt the pattern is that of removing leaven. This points to the separation of men and women in Zechariah and the Gospel, both during the mourning and the discovery of the Resurrection separaetly by women then men.
1. All Scripture from New King James Version
2. There may be dispute as to whether a Passover Meal is observed or the exact date relative to the Passover, but there is no question the meal was before His death.