Yannick Bolasie put Boro ahead in the 20th minute after capitalising on a mistake from Owls defender Julian Borner yet the visitors drew level when Josh Windass converted a penalty before half-time.
Boro improved after the break and retook the lead when teenage striker Josh Coburn headed home his first goal for the club just eight minutes after coming off the bench.
Duncan Watmore added a third for the hosts who moved up to ninth in the Championship table with two games remaining.
Boro will now travel to Luton next weekend before a home meeting with Wycombe on the final day of the season.
The result left Wednesday’s Championship survival hopes hanging by a thread ahead of a meeting with Nottingham Forest.
Here’s how Boro fared at the Riverside.