One of the best ST episodes. Dark. But not the darkest. That one's Hard Time, also DS9. When O'Brien is condemned and has decades of memory of incarceration implanted before his superiors can get their butts down to the planet. Then we see his descent to the bottom.
Yeah that and Inner Light. Like HOW THE FUCK Picard just show up to work the next day and not completely shattered by being forced to live a 75 year life with a wife, kids, and everyone he loves dying?!
Not necessarily dark, but I think the most tragic is "The Sound of Her Voice" where they try to rescue the standard captain on an unbreathable atmosphere planet....