A maze (source of the word "amazing") is a frequent feature in gothic spaces such as haunted buildings or forests.
Labyrinth in common English is a synonym for a maze. In Greek mythology, King Minos of Crete had the craftsman Daedalus built a maze to contain the Minotaur (half-man, half-bull), to whom youths from Athens were periodically sacrificed until Theseus, Athens's founder-king, slew the minotaur with help from King Minos's daughter Ariadne, sister of Phaedra, whom Theseus later married.
Familiar examples of mazes in gothic spaces: winding hallways, secret passages in a haunted mansion or spacecraft (Aliens); the garden maze in The Shining.
Why do mazes recur in gothic fiction and film?
Plot device: journey, suspense, ambush, escape, ingenuity.
Symbol or projection of unconscious mind: anxious, puzzled, seeking. (The locked room in the haunted house where something terrible happened or is hidden is analogous to the human mind's repression of past trauma or forbidden impulses.)
Images of labyrinths or mazes
Stories by Poe often use mazes, e. g. "William Wilson" (1839)
But the house!—how quaint an old building was this!—to me how veritably a palace of enchantment! There was really no end to its windings—to its incomprehensible subdivisions. It was difficult, at any given time, to say with certainty upon which of its two stories one happened to be. From each room to every other there were sure to be found three or four steps either in ascent or descent. Then the lateral branches were innumerable—inconceivable—and so returning in upon themselves, that our most exact ideas in regard to the whole mansion were not very far different from those with which we pondered upon infinity. During the five years of my residence here, I was never able to ascertain with precision, in what remote locality lay the little sleeping apartment assigned to myself and some eighteen or twenty other scholars.
A hint of a similar maze-like gothic structure appears in "The Fall of the House of Usher."
Correspondence between interior & exterior, between mind and maze