Before Maguire's late winner, there had been three red cards at Hillsborough with debutant Emmanuel Frimpong and Jacob Mellis sent off for the visitors, while substitute Jermaine Johnson only lasted 10 minutes on the field before he was dismissed for a high tackle on Brek Shea.
Frimpong's Tykes debut lasted only 30 minutes as he picked up two bookings, before Mellis saw red for a lunge on Jacques Maghoma in the 91st minute.
Below, Sports Mole picks apart an ugly contest between two sides near the bottom of the table.
On target: 4
On target: 3
Was the result fair?
Only just. Despite Wednesday dominating the stats above, they didn't actually look that dangerous for much of the game when they had a numerical advantage following Frimpong's early red card. Barnsley will feel that they have been robbed off a point after a resolute display.
A win's a win and manager Stuart Gray won't care too much that his side didn't play their best today. It looked for all the world like Barnsley would cling on until Maguire's speculative late shot crept inside the near post. The Owls disappointed particularly in the 35-minute period after half time when they should have thrown everything at Barnsley but failed to apply sustained pressure. Johnson didn't earn the start and will now miss the next three games after his disgustingly high challenge on Shea. New Arsenal loanee Benik Afobe worked hard and looks to be a decent replacement for Connor Wickham, whose loan at Hillsborough ended last week.
Hearbreak for the Tykes as all their good work and doggedness were undone with the last kick of the game. Danny Wilson's side shouldn't have stood a chance after losing Frimpong so early, but did ever so well to prevent Wednesday from overpowering them. Wilson will now be without Frimpong for next week's visit of Ipswich Town, while Mellis will miss the next three matches for his childish challenge on Maghoma. The former Chelsea man was frustrated not to have been awarded a penalty moments earlier, but there was no excuse to go in studs-up like that.
Sports Mole's man of the match
Chris Maguire: Even before his last-gasp winner, the right-sider was probably edging the man-of-the-match award. He was a constant pest for Barnsley and the one Wednesday player who deserved a goal the most.
Plenty of bad decisions in this game, but surely none are more idiotic than Frimpong's to dive in from behind on Lee and get himself sent off. The former Arsenal man may have been harshly booked for his first yellow card but gave Andre Marriner no choice by jumping like he did. Yes, he got the ball, but you cannot come through the man like that.
A hectic afternoon for Marriner but he got most things right. The first yellow on Frimpong was harsh but the other two red cards were definitely the right decisions. If Wednesday or Barnsley for some reason appeal against them, then they won't have any luck with the FA. Elsewhere, Premier League regular Marriner correctly booked two players for diving, but did fail to award Wednesday a penalty midway through the second half when Stephen Dawson clipped Caolan Lavery's heels in the box.
Wednesday: The Owls, who have climbed up to 17th in the table, can make it eight games unbeaten if they avoid defeat next week at sixth-placed Reading.
Barnsley: Lowly Barnsley, meanwhile, face a visit from Mick McCarthy's playoff-chasing Ipswich Town.