Frenchman Anthony Modeste tapped in a minute from the end to snatch the winner and leave Leverkusen in fourth place on 44 points, six behind the last automatic Champions League spot, currently held by Schalke 04.
Hoffenheim, eager to take revenge for a controversial defeat earlier in the season, stunned the hosts with an audacious penalty from Sejad Salihovic, who chipped the ball straight into the middle of diving Bernd Leno's goal.
Leverkusen, who had no real chance to score until then, levelled with a well-timed Stefan Kiessling header from an Emir Spahic cross in the 39th minute.
Kiessling, who took his league goal tally to 12, also scored in their win over Hoffenheim earlier in the season, a shot that turned out to have slipped through the side netting, triggering calls for the introduction of goalline technology.
The visitors immediately restored their lead when Kevin Volland capped a superb run with a curled left-footed shot from 18 metres a minute later, confirming his status as one of the most sought-after strikers in the Bundesliga.
Leverkusen pulled level again with captain Simon Rolfes turning and shooting from close range before Modeste's fine touch in the box ended Leverkusen's hopes of taking a point.
In Sunday's other match Eintracht Frankfurt put some distance between themselves and the relegation zone, easing past Nuremberg 5-2, who drop to 17th on 23 points.
Frankfurt took a 3-0 lead before Nuremberg launched a comeback with goals to Josip Drmic and Jose Campana.
Their fightback was short-lived however as they had Javier Pinola sent off for bringing down Joselu outside the box.
Joselu and Vaclav Kadlec struck late in the game to secure Frankfurt's first win in three games.
Bayern Munich are a win away from securing their 24th German league title after beating Mainz 05 2-0 on Saturday.
They can set a record for the fastest title if they beat Hertha Berlin on Tuesday and clinch the trophy with seven games left.
Fellow Champions League quarter-finalists Borussia Dortmund stay second after a 3-0 win at Hanover 96 but remain some 23 points behind Bayern and one ahead of Schalke, 3-1 winners over Eintracht Braunschweig.
- Sports & Recreation
- Eintracht Frankfurt