Luke 1:36 describes Mary and Elizabeth as relatives (συγγενίς). The King James Version describes them as cousins, but most other translations simply say they were relatives. Given the ambiguity of the text, we can not say that Jesus and John were actually (second) cousins, but it appears from this that they were related and would have known each other.
In ancient Jewish society, priests had to be from the tribe of Levi,but any woman of the tribe of Judah could marry a priest. This means that Elizabeth need not have been a Levite. However, there is another explanation for the relationship that is only described in Luke's Gospel, which can be deduced from the views of some New Testament scholars.
Uta Ranke-Heinemann, in Putting Away Childish Things, finds much that is problematic about Luke's depiction of Elizabeth. On page 46, she concludes that Elizabeth was not a historical person, saying this is proved by the historically more credible report in John that Jesus and John the Baptist did not know each other. John Shelby Spong agrees with Ranke-Heinemann, saying in Why Christianity Must Change or Die: A Bishop Speaks to Believers In Exile, page 35, that what makes him suspicious is that Elizabeth in Hebrew would be Elisheba - a name that appears only once in the Old Testament (Exodus 6:23), where she is the wife of Aaron, the brother of Moses. Luke 1:5 introduced Elizabeth as the daughter of Aaron, so had Aaron and Moses in mind when he wrote his gospel.
According to Jewish law, there was no inconsistency in Elizabeth being a relative of Mary, as described in Luke's Gospel. In any case, some scholars and theologians such as Ranke-Heinemann and Spong, provide a clearer resolution based on Elizabeth's supposed legendary status.