Hoffenheim nearly saw a two-goal lead slip away against nine-man Gladbach, but held on for three points.