Thanos Advantages/Win Cons
For Thanos himself, he starts out with a minor attack potency advantage but a stagger lifting strength advantage, meaning any grab altercation with these two will result in Thanos manhandling Danny especially given he's more skilled and experienced in close combat. I'll assume this is not the Thanos with the helicopter blade since it's not mentioned in the OP, though he has the complete gauntlet so I don't think he'd bother using it regardless. His heat and electricity resistance should allow him to tank Danny's ghost stinger and the heat from his energy attacks.
With the infinity gauntlet, Thanos has an even bigger AP advantage starting out. His leading move won't work due to Danny's physiology, but space stone forcefield/attack reflection with allow him to throw Danny's energy attacks back at him and do real damage, or he can absorb his attacks and thus nullify them. The various Transmutations, Biological, Petrification stuff would at most just slow Danny down but not effectively incapacitate him. Time stone can be used to recover damage done to him as well, plus the gauntlets time manipulation looks layered so it should bypass Danny's Time medallion resistance.
He can do other stuff with the gauntlet but the stuff I mentioned was what I found noticeable that he himself specifically used.
Danny's Advantages/Win Condition
Danny can catch up and surpass Thanos in attack power due to his various amps, allowing him to do serious damage or knock him out if he lands a hit. Body Control, Intangibility, and Regeneration would help counter the skill gap as it would make a physical assault from Thanos ineffective. His Ghost Physiology also will allow him to regenerate/reform from the snap or any other physical alterations Thanos would potentially do to him, although he'd half to keep fixing himself willingly. Invisibility counters Invisibility, plus Danny can see invisible beings so Thanos can't hide.
Most of Danny's beams and such can be dodged or countered, however, Thanos has no resistance to cold so if Danny's ice rays or cold energy touched Thanos, he's a popsicle. Possession through contact is an effective win method as Thanos has no resistance to it. Duplication isn't too helpful (We saw jumping Thanos wasn't super effective) however, given Danny's duplicates are far more versatile compared to the groups that fought Thanos (Minus Dr. Strange) they should still be helpful in diversion.
My Vote
I'm gonna vote for Danny, he'll survive the snap, then he's equipped to deal with almost all of Thanos in character moves, meteor drops, transmutations, and so on. Sure Thanos has Time Manipulation but he's never taken it to the extreme. I don't believe Thanos would reach down into his out of character bag with the gauntlets other abilities that could effectively take Danny down before Danny incapacitates him through freezing or possessing him. In the long run sure, I can see Thanos pulling the win but at that point Danny's going to have the power to one shot him.
Effectively, I see Danny landing his win conditions faster than Thanos lands his.