Two break points went begging in the third game but the Scot powered a return two games later to break for 3-2.
He had to save a break point of his own in the next game before another return winner gave him the set.
Murray has made a habit of starting the season strongly, winning the title in Doha in 2008 and 2009 and repeating the feat in Brisbane the last two years.
He returned to Qatar this year because it allowed him to get extra matches in at last week's exhibition tournament in Abu Dhabi.
There was no let-up from Murray as he raced into a 3-0 lead in the second set, but Mayer went on the offensive and withstood a barrage of pressure to level.
He then made it four games in a row to move ahead in the set, taking advantage of Murray's obvious frustration.
The British number one stopped the rot to force his opponent to serve for the set, but Mayer was on a roll and clinched it to love.
And the 30-year-old German continued to keep Murray on the back foot with another break at the start of the decider, time and again forcing his opponent out of court with angled backhands.
Murray could make no inroads on the Mayer serve, and he began to look very weary as the German broke again to lead 5-2 before polishing off a notable victory.