Interesting question. Ultimately, however, about the only way your question can be answered is with a mixture of content: part "biblical and cultural context," and part "sanctified imagination" (i.e., opinion). I'll tackle each part of the mixture, with my primary emphasis on the cultural context.
In ancient NME culture, for a married woman to remain childless was considered as Elizabeth herself said, a "disgrace." One of the words for a childless wife in those days was indeed demoralizing: barren! (If you were to ask me to say the first word that comes into my mind when you say the word barren, I would be sure to say desert! My point: the word probably cut like a knife when it was uttered in the presence of a childless woman in those days.)
A barren womb in Elizabeth's day (not to mention the barren women who were part of the historical narrative in the Tanakh) was a source of shame, disgrace, and embarrassment. Her "failure" to provide her husband with a son to carry on the family name was even cause for divorce. Moreover, in a society in which women in general, with very few exceptions, did not even qualify as second-class citizens, for a woman to be unable to give her husband a child served to compound her lowly status.
According to Hector Avalos, another way of looking at barrenness is as ab-normal and as a disability, associated as it was in Tanakh with illness (Deuteronomy 7:14) and with an affliction, which was not only under the control of a "divine sender/controller" (see Genesis 29:31, where YHWH opened Leah's, but not Rachel's, womb), but was also considered something which could be healed, as in the case of the women in Abimelech's household, whom God made barren for a time because of Abraham's treachery (Genesis 20:17)!
Fertility, on the other hand, was highly prized in ANME culture, and it was considered the "norm," but also a blessing from God (or "the gods of fertility"!). Jacob on his deathbed, for example, linked the work of the Almighty (El Shaddai) with "blessings of the breast and of the womb" (49:25). Notice, too, Sarah did not necessarily blame God for her barrenness, but she thought, rather, God had prevented her from getting pregnant (Genesis 16:2), which is quite accurate, since God planned only to delay her pregnancy until such a time that only a miracle could make it happen for both her and husband Abraham!
In concluding this cultural/contextual part of my answer, we can safely conclude the denigration of woman by other women for being barren (e.g., Hagar in Genesis 16, and Peninah in 1 Samuel 1:6) was hard for infertile women to bear.
As for the second part of my answer, the opinion part, there are any number of possibilities for Elizabeth's self-imposed seclusion for five months:
Her advanced age, combined with her concern about "what people might say about her" if she were to announce to the world she was pregnant! Put yourself in her place. If you and your husband were well beyond childbearing years, would you be eager to let the world know--at least before you obviously began to "show"? I don't think so! I myself would not want people to think me crazy for claiming something so preposterous, humanly speaking.
If most, or all, of her "peers" had already died, before whom would she be able to "show off" her blessed condition?
Perhaps since her husband Zechariah had been struck dumb by the angel who announced the miraculous pregnancy to him in the temple, Elizabeth, too, decided to remain dumb, so to speak, for a time. When Mary the mother of Jesus arrived at month five, however, she may have ended her self-imposed seclusion.
Her seclusion was simply her way of dealing with this remarkable situation. Perhaps she was an introverted and inward person who, like Mary, liked to treasure things up in her heart, rather than broadcasting things to the world.
You and other readers can probably suggest a multitude of other reasons for Elizabeth's seclusion. It is pretty clear to me, however, that each possibility or explanation is at best conjecture.