To apply this metaphor to "The Cask of Amontillado," the story must be read as strictly an allegory. The first section of the story represents the mind's relaxation and euphoria as it begins to lose consciousness. As the characters retreat from the "carnival madness" -- wakefulness -- they move into a dark place and drink wine, which relaxes their bodies.
The second section, as they pass among the bones of Montresor's ancestors, shows the relationship of a person's past to his dreams and ambitions. Many dreams focus on past events and connect them to present or even future events; the skeletons in the catacombs represent both Montresor's past and Fortunato's future.
Finally, the act of walling a person in alive was a strong fear of Poe's, and so represents his personal nightmare; he has moved beyond representational dreams and into the disconnected madness of nightmares, which often are not scary in retrospect. It becomes all about context and the fear of immediate and sudden phobias, which are one powerful root of nightmares.