John the Baptist was a weird but essential figure in the ministry of Jesus. The Gospels suggest that the men are cousins through their mothers. John’s parents were Zechariah and Elizabeth. Jesus’ parents need no introduction. The Gospels, especially Matthew and Luke, only go as far back in their stories as when Joseph and Mary were already betrothed. Hence, we have no biblical records of the birth of Mary or Joseph.
The Quran, on the other hand, has quite a bit to say about the birth of Mary, her childhood, and, as I will explain, how Joseph was chosen for her as a husband. We find this story in Quran 3:35-44,
Surah Aal-e-Imran, Verse 35:
إِذْ قَالَتِ امْرَأَتُ عِمْرَانَ رَبِّ إِنِّي نَذَرْتُ لَكَ مَا فِي بَطْنِي مُحَرَّرًا فَتَقَبَّلْ مِنِّي إِنَّكَ أَنتَ السَّمِيعُ الْعَلِيمُ
When a woman of Imran said: My Lord! Surely I vow to Thee what is in my womb, to be devoted (to Thy service); accept therefore from me, surely Thou art the Hearing, the Knowing.