Gladbach bowed out of this season's Champions League having finished bottom of their group, but the win over Hoffenheim boosts their hopes for next season.Â
The result keeps Andre Schubert's Gladbach fifth in the Bundesliga table, but just one point from fourth, which carries a place in the Champions League play-offs.
Gladbach took the lead at Borussia Park on seven minutes when Hoffenheim defender Jeremy Toljan beat Andre Hahn to the ball, but stabbed it into his own net.
Gladbach doubled their tally when Brazilian forward Raffael's shot was blocked by Hoffenheim goalkeeper Oliver Baumann, but Mahmoud Dahoud slammed home the loose ball just before the break.
Hoffenheim's Croatia striker Andrej Kramaric, on loan from Leicester City, pulled a goal back after the Gladbach defence was pressed into a mistake on 54 minutes.
But Gladbach's Hahn made sure of the three points just seven minutes later when he fired home Dahoud's final pass with a shot which gave Baumann no chance.
Hoffenheim remain three points clear of the relegation play-off place under Julian Nagelsmann, the youngest ever coach in Germany's top flight.
The 28-year-old has dragged them out of the bottom three since taking charge in February.
After consecutive defeats, the victory will boost Gladbach's confidence ahead of next Saturday's away clash at Bayern Munich.
Pep Guardiola's Bayern will be confirmed as the first team to win four straight German league titles if they beat Gladbach at the Allianz Arena.
But the visitors are chasing a rare double over Bayern having beaten the Bavarian giants 3-1 at Borussia Park in December.
Guardiola's Bayern play Atletico Madrid away in the Champions League semi-final first leg on Wednesday and are chasing a repeat of their 2013 treble of Champions League, Bundesliga and German Cup.
Bayern stayed seven points clear at the top of the table with a 2-0 league win at Hertha Berlin on Saturday thanks to goals by Arturo Vidal and Douglas Costa.
Later on Sunday, second-from-bottom Eintracht Frankfurt boosted their chances of survival with a 2-1 win at home to Mainz.
Frankfurt were gifted the winner on 84 minutes when Mainz's Stefan Bell turned the ball into his own net from Anis Ben-Hatira's cross.
Despite the defeat, Mainz remain sixth in the table and on course for a Europa League place.
The result effectively relegates bottom side Hanover 96, who are nine points from Werder Bremen in the relegation play-off place with only three games left.
Frankfurt are now one point adrift of the play-off place and three points from outright safety.