The German defender's 90th-minute goal, touched in after an Aaron Mooy shot was deflected into his path, sparked a skirmish involving players from both sides and both benches, with rival bosses David Wagner and Garry Monk sent to the stand.
It was a deserved victory for Wagner's men, who went in front through Izzy Brown, only for Chris Wood to equalise before the break.
Town had the better of the second half, and finally made their dominance count when fans' favourite Hefele notched his fourth goal of the season.
21mins: Collin Quaner finds some space in Leeds area after Kasey Palmer's pass and shoots, but Rob Green makes the save.
25mins: Quaner chases down Pontus Jansson, whose hurried clearance ricochets off the Town man and loops onto the roof of the net.
27mins: Izzy Brown, just on in place of Palmer, puts Town ahead with a close-range finish from Tommy Smith's cross.
35mins: Leeds grab a disputed leveller - Town claim offside as Wood nets from Kyle Bartley's flick-on but TV replays suggest the officials got it right.
36mins: Elias Kachunga's drive is blocked by Gaetano Berardi.
37mins: Keeper Green denies Quaner.
38mins: Michael Hefele heads just wide from an Aaron Mooy corner.
45mins: Pablo Hernandez puts a dangerous-looking 20-yard free-kick into the Town wall.
51mins: Jonathan Hogg makes a double clearance from a Leeds corner.
52mins: Bartley slices a Rajiv van La Parra cross over his own bar.
58mins: Mooy shoots across face of goal and wide.
65mins: Saves at each end as Quaner is denied at close quarters and Stuart Dallas from distance.
77mins: Joe Lolley curls a shot over from distance.
82mins: Christopher Schindler delivery goes right across face of goal and wide.
90mins: Mooy's shot is defected into the path of Michael Hefele, who touches the ball home.
Town: Ward, Smith, Hefele, Schindler, Lowe, Hogg, Mooy, Kachunga, Palmer (Brown, 25), Van La Parra (Lolley, 65), Quaner (Wells, 65).
Subs not used: Whitehead, Hudson, Cranie, Coleman.
Leeds United: Green, Ayling, Jansson, Bartley, Berardi, Vieira, Bridcutt, Hernandez (O'Kane, 82), Doukara (Pedraza, 62), Dallas (Barrow, 75), Wood.
Subs not used: Cooper, Antonsson, Coyle, Silvestri.
Referee: Simon Hooper (Wiltshire).