The first effort of the game came from the visitors, but Sebastien Pocognoli's effort from distance was slashed high and wide.
The first half action was not done there. Hannover were looking the better team but they were forced to go in level as Vedad Ibisevic met a Harnik cross at the near post for a quick equaliser.
Not long after the restart Stuttgart were back in front in this pulsating encounter. Moritz Leitner carried the ball forward on the break before sliding in Ibrahima Traore, who finished across the goalkeeper from an angle.
Then Konstantin Rausch wrapped up the result with five minutes to go with a fine left-footed strike.