When we look at the genealogy of Jesus provided in the Gospel of Matthew, we find that it traces the lineage of Jesus from Abraham to Joseph…not Mary. Nowhere in the Gospels are we given an explicit account of Mary’s family tree. This being said, there are several issues to be taken into consideration. First, it was the usual custom that marriages take place within tribes so it is possible (though by no means certain) that Mary also belonged to the House of David.
Second, Luke’s Gospel describes Elizabeth, a relative of Mary, as belonging to the daughters of Aaron (the priestly tribe of Levi) so one could easily assume that Mary was of Levite heritage. Third, Joseph’s decision (with a little divine encouragement) to formally wed the pregnant Mary signifies the legal adoption of Jesus in Jewish tradition. Such an act would make Jesus a legitimate member of the House of David. So, the bottom line is this: if we consider that the ancient liturgy, art, and theology of the Church is rich with images of Jesus as both High Priest and High King, it might make sense that he was born of a Levite (the priestly tribe) and raised by a member of the House of David (the royal tribe).