Abilities
Danny: Danny's best ability is his invisibility and his various effects of phasing, such as possession and soul destruction, which Danny has used in various fights a lot, including on the bat some times. Thanos's soul stone can detect where souls are, but there is a chance Thanos will be confused enough that Danny blows him up before that happens. Ice, corporeal attacks, and EctoPlasma can be countered in various ways by Thanos, most notably with effects of the Reality Stone, however, invisibility can still turn the tide of the fight if he decides to use it off the bat, which he may do if he gets dusted and comes back (Danny can do it by thought, so if he does it it will likely go back to the soul stone scenario)
Thanos: The snap, the main attack can be countered by Danny's regeneration. Power Stone can't work due to AP gap. On top of which, Danny can counter pretty much everything the space stone does due to phasing out of it with the exception of him being sucked into a black hole. Thanos's best ability to beat Danny is the reality stone and turn him into stone/transmute him, however, he may not use it in time before Danny blows him or his soul apart.
Danny 7/10.
Experience
Danny: Danny's main experience with a character who acts like Thanos was freak show, however, freak show is notably more cocky than Thanos, and taunting Thanos wouldn't really work here. However, his overall vast experience may help him in various aspects, such as dealing with Thanos's telekinesis or what to do to take him down
Thanos: Thanos is easily more cocky than Danny, albeit less than freak show. As for experience, Thanos knows how to use the Space-Reality-Power stones the most, and will likely use them in various ways. However, he has not fought a versatile opponent like Danny except for Doctor Strange, and unlike Danny, none of the other avengers were as dangerous to Thanos as the ghosts who challenged Danny.
Danny 6/10.
Who wins??
While Thanos has some scenarios in which he can come out on top, Danny has simply more options due to more edged out experience and a winning ability which would be used more likely than Thanos's options