Stefan Lex had given the visitors the lead early on, only to be pegged back by Mark Uth before the break.
Andrej Kramaric's penalty was saved by Ørjan Nyland and looked like it would prove costly, though Nadiem Amiri popped up to earn a huge three points.
Level-pegging at the half
It was a rather rough open for Hoffenheim, who had Oliver Baumann to thank after Dario Lezcano managed to get the better of Niklas Süle and poke at goal. It wasn't long later that a stray elbow from Benjamin Hübner caught Ermin Bicakcic and burst the defender's forehead open.
To make matters worse, Ingolstadt scored while he was off the pitch. A brilliant ball forward from Marvin Matip caught the Hoffenheim defence off guard, and allowed Lex to control and go through on goal. The winger was deadly accurate with his finish, thundering the ball past the helpless Baumann.
Very little happened after that, though the boredom was broken by Uth's well-worked equaliser. A wonderful passing move, started by Eugen Polanski in midfield, eventually saw Kramaric feed Uth. The German forward wasted no time in sorting his feet and leveling the scores.
Amiri saves the day
The second half began with a penalty for Hoffenheim, although they failed to convert. After Kramaric had been brilliantly denied by Nyland, a foul on Uth afterwards meant that the Croatian had another bite at the cherry from 12 yards. He looked nervous but the penalty was headed right into the bottom corner, only for Nyland to make a super save.
Controversy wasn't far away at the other end and Pascal Groß felt he sound have has a spot-kick of his own when felled by Bicakcic. However, the ball broke kindly for Moritz Hartmann and he took aim for the far corner. Not for the first time this season, Baumann pulled off a stunning stop to save his side.
The Hoffenheim stopper would need to be at his best again to deny Alfredo Morales' drive, but his opposite number was doing a fine job himself; Kevin Volland and Uth couldn't believe their luck when the Norway stopper kept out their efforts.
A draw, given the performances of both 'keepers, would have been fair - but Hoffenheim had other ideas. A stunning run from Pavel Kaderabeck opened up space for Volland, who had the vision to pick out Amiri in the middle. The youngster swept past a wrong-footed Nyland, and that sealed a much needed win. The win took Hoffenheim six clear of Werder Bremen in 17th, with Ingolstadt a further three points ahead of their Sinsheim opponents.