Ancelotti experimented with a new-look line up ahead of Tuesday's visit by Atletico Madrid in a meaningless Champions League game.
There were three main changes to Bayern's tactics on Friday as Ancelotti adopted the approach of predecessor Guardiola, who steered Bayern to the German league title in each of his three seasons in charge.
After a knock to Xabi Alonso, Ancelotti used the same 4-2-3-1 system Bayern used in 2012/2013 when they won the treble of Champions League, Bundesliga and German Cup titles under Jupp Heynckes.
He switched from his usual 4-3-3 line-up, using four players on attack, the minimum number of forwards Guardiola used to field.
For the first time since March, Bayern were able to start with Guardiola's preferred wingers, using injury-prone veterans Franck Ribery, 33, on the left and Robben, 32, on the right.
And Ancelotti also switched Thomas Mueller in from the wing, playing the Germany star as an attacking midfielder just behind Robert Lewandowski, another trademark Guardiola selection.
Poland hot-shot Lewandowski led the scoring with two goals after Mainz had taken an early lead at the Opel Arena.
Colombia's Jhon Cordoba put the hosts ahead with four minutes gone before Ancelotti's side, enjoying 72 percent possession, hit back with two Lewandowski goals sandwiched between an Arjen Robben header.
"We haven't played like that for weeks. We were really good," enthused Robben.
"We played using Thomas as a 'ten', that was the key to our success," inisted Robben.
"Thomas tears open the spaces.
"We have a lot more movement, more surprises in our play, which is what had been lacking in the last few weeks."
The win in Mainz was Bayern's second straight league victory following a three-match winless spell, which included defeats at Borussia Dortmund in the Bundesliga and at Rostov in the Champions League.
Mueller, who has yet to score a goal in Germany's top flight in his 11 league games, benefited from playing in front of midfielders Thiago Alcantara and captain Philipp Lahm, who was moved in from right-back.
"I was well involved in the game and formed a good triangle with Philipp and Thiago," said Mueller.
"When the coach told me we'd be playing differently, I was looking forward to it -- I was allowed to play in my favourite position and I had to deliver.
"After the early shock, we moved well in attack and had a good grip on the game."
In the Champions League, Atletico are confirmed as Group D winners, qualifying alongside Bayern who can only finish second, regardless of the result, due to away defeats to both Madrid and Rostov.
Following Atletico, Bayern then face Bundesliga strugglers Wolfsburg and Darmstadt before their crunch showdown at home to RB Leipzig on December 21 with both teams battling for top spot in Germany's top flight.