The tribe of Judah and the tribe of Levi are tied together by the marriage of Aaron from the tribe of Levi to Elisheba from the tribe of Judah. Elisheba in Exodus 6:23 is the sister of Nashon who is the grandfather of Boaz who was Ruth's husband. Elisheba was also Boaz's great Aunt.
Below is how they fit into the genealogy of the tribe of Judah & the tribe of Levi:
Judah's son Pharez by Tamar his daughter-in-law had a son named Hezron whose son was Ram. Ram's son was Amminadab who had a son named Nashon and a daughter named Elisheba who married Aaron. Nashon had a son named Salmon who had a son named Boaz. His son was Obed who had a son named Jesse who had a son named David.
Levi (Judah's brother) had a son named Kohath whose sister was Jochebed. Kohath son was named Amram who married Jochebed his Aunt who was his father Kohath's sister. (Exodus 6:20). Their children were Aaron, Miriam & Moses. Aaron from the tribe of Levi married Elisheba from the tribe of Judah.