Yes
The spell monstrous physique iii allows you to polymorph into a monstrous humanoid, which is minotaur's type. Natural Cunning is listed as one of the abilities you can gain from this spell, if the base form has it, and the minotaur does:
Natural Cunning (Ex) Although minotaurs are not especially intelligent, they possess innate cunning and logical ability. This gives them immunity to maze spells and prevents them from ever becoming lost. Further, they are never caught flat-footed.
Since maze is a spell with a duration, you can't be affected by it if you are a minotaur, since while in minotaur form you cannot be affected by the maze spell or lost in a maze.
According to the rules on immunity, a creature immune to a spell "does not suffer from its effects", which means that even if it began under a spell's effect, it would not suffer the spell's effects once it gained immunity.
A creature with immunities takes no damage from listed sources. Immunities can also apply to afflictions, conditions, spells (based on school, level, or save type), and other effects. A creature that is immune does not suffer from these effects, or any secondary effects that are triggered due to an immune effect.
This specifically refers to the Immunity special quality, but I think it's reasonable to assume that the ability Natural Cunning, which grants "immunity to maze spells", works the same as an ability called Immunity: maze.