Jan Schlaudraff scored Hannover's opener shortly after the break before Mame Biram Diouf made it 2-0 in the 53rd minute.
Alvaro Dominguez pulled a goal back after 70 minutes, Roel Brouwers equalising seven minutes later, leaving Juan Arango to score the winner 11 minutes from time.
Hannover had not lost at home in 22 Bundesliga matches - their last defeat coming on April 30, 2011 against Gladbach - but today's loss saw them slip to 10th place.
Gladbach, who had lost their last two away games, climbed to ninth place thanks to their dramatic comeback.
Hannover had the first chance of the game after 19 minutes as Lars Stindl played a wonderful ball through to Diouf, but the Senegalese striker could not beat Gladbach keeper Marc-Andre ter Stegen.
Arango went close to giving the visitors the lead with a free-kick just before the interval, the ball curling around the wall but flying inches wide of the right post.
Hannover grabbed the lead three minutes after the restart, Ter Stegen getting his hand on Schlaudraff's long-range effort but only managing to deflect the ball off a post and in.
The hosts doubled the advantage after 53 minutes with a smart manoeuvre from a free-kick, Konstantin Rausch crossing into the middle for Diouf to back-heel the ball into the net.
Gladbach refused to give up and Igor de Camargo was unlucky not to beat Hannover keeper Ron-Robert Zieler in the 55th minute.
The visitors pulled a goal back - and just their second away from home this season - in the 70th minute as Zieler parried Arango's shot into the path of Dominguez, who calmly slotted home.
Gladbach finally equalised in the 77th minute as Arango's free kick from the left found Brouwers, who headed home from close range.
And the comeback was complete two minutes later thanks to a stunning free-kick from Arango, who snuck the ball just inside the left post to beat Zieler.