Yume Nikki fangames like Yume 2kki do not implicate it.
Whether Touhou fangames implicate Touhou seems to be somewhat inconsistent. We have ones like Touhou Mother and Touhou Mystia's Izakaya that do, but the more popular Koumajou Densetsu series does not, and even some Tasofro games like New Super Marisa Land and PatchCon don't.
Some consistency would be nice to have here, but I'd say Touhou is an outlier compared to other copyrights in that ZUN has released guidelines for the creation of fan content based on the Touhou IP, and fangames that follow those guidelines are unambiguously legal. The legal status of fangames of even freeware like Yume Nikki is unclear in comparison, while if the Danganronpa Another games ended up in court for copyright/trademark infringement, it seems probable that their only hope would be presenting themselves as parodies.
I'm not sure whether that distinction should actually affect how we handle fangames here on Danbooru, but I don't see any other grounds for treating Touhou fangames differently from those based on other copyrights.