Kevin Blackwell's high-flyers kept their hopes of automatic promotion alive in a dramatic finale that left Barnsley with an uphill struggle to avoid the drop.
The goals came in a lightning nine-minute spell which ended with Blackwell and Barnsley boss Simon Davey having to be separated by police as they squared up to each other on the touchline.
It was the first time the two sides had met since United centre-back Chris Morgan's challenge with striker Iain Hume at Oakwell left the Canada international with a fractured skull and needing brain surgery. Both clubs had appealed for calm.
United, who have hit form at just the right time with a surge of five wins from eight league games, almost snatched an early lead after Jamal Campbell-Ryce had fired a 25-yard shot wide of the Sheffield United goal.
David Cotterill launched a teasing free-kick from the left as midfielder John-Joe O'Toole stretched to stick out a foot, stabbing the ball a fraction wide at the far post.
Bobby Hassell squandered a half-chance ballooning his free-kick from the edge of the area high over the target before a Greg Halford long throw caused problems in the Barnsley goalmouth.
Morgan was the first to react, his header looping into the area but, as striker Darius Henderson raced in, he was beaten to the ball by giant German keeper Heinz Muller.
The Oakwell side, content to hit the Blades on the break, almost found a way through, former United full-back Rob Kozluk hitting a long diagonal pass to the Anderson Silva but the Brazilian midfielder just failed to connect eight yards out.
Henderson almost broke the deadlock when his stinging shot knocked Muller off his feet before the keeper pulled off a spectacular stop minutes before the break, palming a Jamie Ward header over the top.
Malta international Michael Mifsud saw his fierce drive pushed out by the diving Paddy Kenny before Halford almost got the breakthrough, heading a Cotterill corner over the top from eight yards.
United swept ahead in the 82nd minute, O'Toole bundling the ball over the line from Leigh Bromby's long throw. Substitute Arturo Lupoli added the second on 87 minutes before more drama.
Darren Moore was brought down in the United area but Campbell-Ryce saw his spot-kick saved by Kenny in the 89th minute.
Substitute Daniel Bogdanovic headed in a John Macken cross from close range in the 90th minute and seconds later rival managers Blackwell and Davey squared up to one another and the two benches had to be separated by police.