But in any case, I don't see how a 5th-level party is going to easily handle a dragon unless the DM nerfs the environment in the party's favour.
Well, who claimed it was supposed to be an easy encounter? It's a challenging encounter, but not an overwhelming encounter.
If you can prepare for the encounter, the most important thing to do is to get resistance to acid. Ask your cleric, or get potions/scrolls.
Now regarding non-iconic parties:
I think, there's two basic philosophies:
1) The DM adjusts encounters so the non-standard party doesn't have any problems.
2) The DM doesn't care about the party setup and simply uses a variety of standard encounters.
I'm firmly in the second camp. A party that cannot deal with standard encounters is dysfunctional. PCs will continue to die until the party setup resembles something that _can_ survive standard encounters.
As a DM I will point out potential problems, e.g. when the party currently doesn't include a healer. I expect my players to deal with the situation in some way:
Buy magic items, hire an npc, etc.
Imho, dysfunctional parties are a self-correcting problem.
IIRC, when my players fought the dragon in 'Forge of Fury', one or more of them dropped during the fight, but nobody died. At least two pcs were killed in different parts of the adventure, though:
One dropped to his death when trying to charge over a hanging bridge, and one was killed by sneaking into gray ooze.
Nobody got killed when they encountered the roper, btw. because they were clever enough to realize they had no chance to beat it and instead successfully followed a diplomatic approach.
Note, that this is also a potential solution to overcome the black dragon encounter the OP is expecting. Not every encounter has to be resolved using combat.