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, 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")
Tom Paris compared navigating through the subspace corridors used by the Turei to a maze. (VOY: "Dragon's Teeth")