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.
There is a difference of opinion among scholars about the kinship relations between Zakariyya and Maryam, may Allaah exalt her mention. While some scholars are of the view that he was the husband of her maternal aunt, others believe that he was her brother-in-law. The Maaliki scholar Al-Qurtubi mentioned that the wife of Zakariyya was 'Eeshaa' bint Faaqootha (Elizabeth, the daughter of Faqud), sister of Hannah bint Faqootha (Hannah, the daughter of Faqud), and that Hannah was the mother of Maryam, may Allaah exalt her mention. The same view was also transmitted on the authority of At-Tabari .
On the other hand, it was transmitted on the authority of Al-Qatbi that the wife of Zakariyya was 'Eeshaa' bint ‘Imraan (Elizabeth, the daughter of Imran). According to this view, Yahya (John) was the cousin of ‘Eesa (Jesus) . According to the former view, Yahya was the cousin of his mother Maryam, may Allaah exalt her mention.
Evidence supporting the first view is what was reported by the Prophet, sallallaahu ‘alayhi wa sallam, that during the journey of Israa’ and Mi‘raaj (the Prophet's night journey to Al-Aqsa mosque and the upper heavens) he met the two cousins: ‘Eesa and Yahyaa, may Allaah exalt their mention. We do not know of any kinship relations between them except that the two were from the children of Bani Israa'eel.
Allaah Knows best.