madara in So6P mode almost dies from 8th gate guy... this is a no brainer
That's because he had 1 eye, wasn't using his Rinnegan jutsus, katon jutsus, Susanoo, wood jutsus, or any large fraction of his power while Gai had help from Edo Minato, 6th gate Lee, Gaara, and MS Kakashi.
O.T. The Gravity jutsu was Deva path so no EMS doesn't have that. We don't know much of what EMS Madara have but most likely he can. Considering Sasuke's EMS was starting to track Juubito and Madara mastered the Sharingan beyond anyone else, I'm sure he can track Gai and he shown to have a fast Shunshin himself as he was able to speed blitz Naruto and Sai (both blocked by still were knocked down). Madara also knows the shadow clone jutsu (switched his body with one after Hashirama's fight) and he knows wood clone. He can use flower world that crushes those in its path plus release pollen that renders you unconcious.
PS most likely tank anything Gai has as it tanked a normal powered tbb point blank range with no signs of being damaged. He can use Hashirama's wood Buddha coated with PS if need be since he has access to both and he's the one who created PS coating Kurama. His fan also takes your Attack and reflects it back at you so Gai can also be doing damage to himself. Madara's Katons are powerful enough to cover a huge range as Edo Madara and Obito used on the Alliance. He also have Kurama as a summoning, I wouldn't use this if he was fighting someone who had yin/yang/full Kurama but in this case he can use his summon and I don't see Gai's turtle helping in this fight.
8th gate Gai is said to have power over the 5 Kages but Edo Madara beat them and called it child's play, he wasn't really using a large fraction of his power and the only Rinnegan power he used was Pretha path just to prolong his fun and not because he was being overwhelmed. Upon being revived, Hashirama commented that Madara have his old powers again so it's save to say EMS Madara is above the 5 Kages by a lot. Madara has Hashirama's healing and have great durability to the point of taking direct hits from all 9 Bijuus and not reacting to pain at all. Also if Gai gets in close he can be put under a genjutsu, his clone was able to get A into one after A got distracted; Madara's clones in Susanoo are great distractions. He can also use a delayed Izanagi that revives him after death so even after the fight, if he gets a fatal blow, he'll still be alive as Gai dies from opening the 8th gate.