Personally i like both but would take DR over ZE if i had to choose, that said, here's the main differentiations.
The characters in Danganronpa aren't real people, they are more like extreme stereotypes, especially in game 2 and 3. The game also doesn't pretend any different, while it might sound negative, it's generally a cool, fun thing.
The same is also true for the overarching story that is zany as hell.
Zero Escape is a lot more grounded on the other hand. Still some stereotypes, but the characters are depicted more like real people than parodies thereof.
The story also is rather grouned (compared to DR that is), but goes a bit off the deep end at times as well.
Narratively, Danganronpa is mostly focusing on a bunch of individual murder mysteries per game (with some really incredible ones ) and an overarching mystery plot that goes places of weirdness in a very fun way.
Zero Time Dilemma on the other hand is much more focused on its overarching (mystery)plot that's a lot about (pseudo-)science, mathematical theorems, etc. very Science-ventury, that plot too can become pretty crazy, but wether or not that's a good thing comes down very much to whom you ask.
Furthermore, Danganronpa also has a lot of humor, some of it fairly dark, where as Zero Escape is much more serious.
Gameplaywise, Danganronpa consists mostly of minigames during trials, with some occasional light adventure game elements during crime scene ivnestigations, closest comparison is Ace Attorney, where as Zero Escape are much more classic puzzle games.
Essentially this boils down to
Crazy vs Grounded
Fun vs Serious
Murder Mysteries vs Science-venture.
Real answer tho, just buy both ez.
Also keep in mind that Danganronpa does this weird thing where the story of the first two games is concluded in an anime show while the third game has a new plot.