madame (Old French) comes from Old French dame, from Late Latin domna, from Latin domina, from Latin Dominus, from Latin domus, from Proto-Italic domos, from Proto-Indo-European dṓm, from Proto-Indo-European dem- — to build; to arrange, to put together.
Ancestry of “madame”, step by step
madame traces back through 3 separate lines of ancestry.