The world silver medallist saw off the challenge of defending champion He Wenna of China, who lost control at the end of her routine and claimed bronze, with team-mate Huang Shanshan taking silver.
MacLennan scored 57.305 in the final, 0.575 marks clear of Huang, with favourite He 1.355 marks back.
'I'm pretty happy, I did a good performance,' MacLennan said.
'I always believed that everything was possible, but I was just focusing on my routines. I didn't want to get ahead of myself, because that's when you make mistakes.
'This was definitely the highest score I've ever gotten, but I didn't wanted to get ahead of myself before the Chinese had to compete.
'Nothing matches that experience. It has not fully sunk in yet.'
Nothing matches that experience. It has not fully sunk in yet.Rosannagh MacLennan