Madara battled Hashirama, and that's when he got the Senju DNA.
Madara obtained a small amount of DNA during his confrontation with Hashirama but gained even more thanks to kabuto and his experiments. This gave him the ability to use mokuton; one of the greatest nature styles.