Glück is like Geist -- a German word so context-dependent, it has perhaps 5 or 6 different meanings. The two main meanings of Glück are happiness and good luck. You can look happy (glücklich) because you just found a shirt at a flea market that fits you perfectly -- a lucky (glücklich) coincidence.
Which brings us to the German phrase Glück im Unglück. Unglück is basically the opposite of Glück. So Glück im Unglück is happiness in unhappiness, or good fortune in misfortune. This phrase is apparently based on the German translation (g) of the title of a Taoist parable. One online dictionary translates GiG as "blessing in disguise", but I'm not sure that really captures it. That suggests an experience that, overall, had a positive outcome. Say you're diagnosed with cancer, but your make a full recovery and your life is more meaningful because you now realize Every Day is Precious™.
Glück im Unglück, in my view, points to a situation in which the overall balance at the end of the day is still bad, but not quite as bad as it could have been. Something intervened to ameliorate what seemed like a hopeless situation, or to show an unexpected positive side. But when all is said and done, you still wish the whole thing hadn't happened.
This GIF captures it perfectly (especially since Unglück also means accident in German):