All that I can remember is a prison who's entrance was a huge, gaping (fanged?) mouth.
The hero (who was incognito, and really .. not sure, maybe the heir to the throne?) was thrown down a hole into a large cavern with other prisoners. There was a (supposedly) bottomless pit in the centre, and one of the prisoners had fashioned a lasso from the skin/entrails of dead prisoners.
Eventually, the hero manages to get hold of it & use it climb down the pit to escape.
Not much to go on, sorry. It sci-fi, or at least not an elves & pixies story. Any idea?