A maze was a challenging type of game or study, in which a person or animal must navigate their way out of a confusing set of walls, including some with dead ends.
In 2270, the recreation room of the USS Enterprise had a large maze, which Dr. Leonard McCoy, Lieutenants Hikaru Sulu and Nyota Uhura found themselves in. (TAS: "The Practical Joker")
In 2364, Admiral Mark Jameson compared the complex tunnels on Mordan IV to a maze. (TNG: "Too Short a Season")
In 2369, Dr. Julian Bashir speculated the Wadi had them put into the game of Chula as a behavorial test, like a laboratory rodent trying to find its way out of a maze. (DS9: "Move Along Home")
In 2371, Chakotay compared trying to discover through the computer the crewman on board the USS Voyager who collaborated with the Kazon-Nistrim as going through a maze of circuts. (VOY: "State of Flux")
Later that year, Commander Chakotay asked Lieutenant Tuvok how to navigate through a maze that was constantly changing shape, as the USS Voyager was after encountering a distortion ring in the Delta Quadrant. (VOY: "Twisted")
According to Quark, he had a variety of pleasure mazes in his holosuites and they all had a surprise at the center. (DS9: "Rapture")
Tom Paris compared navigating through the subspace corridors used by the Turei to a maze. (VOY: "Dragon's Teeth")