However, the Russian side will hope they will not be made to rue Samuel Eto'o's missed second-half penalty.
Hannover took a 22nd-minute lead through Szabolcs Huszti but Eto'o drew Anzhi level soon after and Odil Ahmedov put the hosts ahead immediately after half-time.
Eto'o then spurned the chance to make it 3-1 in the 57th minute when his spot-kick was saved by Ron-Robert Zieler, but Anzhi were still able to secure a two-goal lead to take to Germany for the second leg thanks to Mbark Boussoufa.
Hannover, who lost to eventual winners Atletico Madrid in last season's quarter-finals, started in confident fashion and had already gone close on a couple of occasions before taking the lead through Huszti.
The Hungary international, who returned to Hannover last summer after three years in Russia with Zenit St Petersburg, drilled home left footed from the edge the edge of the area after Mame Diouf had laid the ball back to him.
That was the first goal Anzhi had conceded on home soil in six European games, but they were behind for just 12 minutes before Eto'o levelled.
The former Barcelona and Inter Milan hitman, who was a doubt before the game with a back complaint, slotted home from close range following good work from new signing Willian on his Anzhi debut.
Guus Hiddink's men then got their noses in front three minutes into the second half when Ahmedov fired home a fine effort from 20 yards out.
Anzhi really should have further extended their lead nine minutes later when Christian Schulz brought down Eto'o inside the area, but the prolific Cameroon striker saw his resulting spot-kick parried by Zieler.
That was a big let-off for Hannover, and it remains to be seen how crucial that miss might prove in the end even though Anzhi did still manage to grab a third goal at the Luzhniki stadium.
Eto'o went some way towards making amends for his penalty miss as he set up Boussoufa to notch in the 64th minute.
Both sides had chances in the closing stages but Zieler and his Anzhi counterpart Vladimir Gabulov came out on top to leave Anzhi holding a healthy, if not decisive, advantage heading into the second leg.