Ten-man Wednesday returned to winning ways after a six-goal thriller with Bournemouth ended in their favour.
In an incident-packed Championship clash, Atdhe Nuhiu gave the Owls the lead in the first half before Mark Pugh promptly equalised.
Sam Hutchinson restored the advantage with his maiden goal for Wednesday, who went down the tunnel in the driving seat.
But the visitors’ plans went askew in the second period as firstly Yann Kermogant hauled the home side level before Hutchinson saw red for accruing two yellow cards.
Bournemouth then pressed and looked the more likely, only for the Owls to counter near the end and claim victory courtesy of Leon Best and Chris Maguire.
Gray named a strong side for the trip to the Goldsands Stadium, making one change with Jeremy Helan getting the nod ahead of Liam Palmer.
And it was Wednesday who started brightly and created the first chance after five minutes.
Maguire broke from inside his own half before delivering for Nuhiu, who nodded on for Kieran Lee at the back stick but the midfielder fired agonisingly wide of the target.
But back came Bournemouth and dangerman Lewis Grabban engineered a yard of space in the area and struck fiercely on target but Chris Kirkland made a fine save to push around the post.
The hosts, though, then became architects of their own downfall when Nuhiu picked up possession from a loose pass and charged upfield before blasting low past Lee Camp with a powerful left-footed drive.
Maguire almost capitalised on another defensive mix-up by the Cherries moments later but Steve Cook made a vital last-ditch challenge to prevent the Scot pulling the trigger.
Both sides were showing plenty of purpose going forward and it was a swift move that saw Bournemouth back on terms.
Grabban did well on the wing and stood up a perfect ball for Pugh, who powered home a fierce header to level.
But almost immediately, the Owls regained their lead.
Lewis Buxton delivered into the centre and after Nuhiu flicked on at the near post, Hutchinson was perfectly placed to nod into the net.
As the interval approached, Andrew Surman brought another outstanding save from Kirkland, who got down to push wide for a corner.
The Owls suffered a blow just after the resumption when Buxton went down with what appeared to be a knee injury and was withdrawn – Palmer came on from the bench.
The ding-dong nature of the match continued and as the Cherries asked more of the questions, the answer was a second equaliser.
Matt Ritchie swung a teasing corner into the mix and Kermogant buried an unstoppable header past Kirkland.
It was all Bournemouth thereafter, with the Owls on the back foot after Hutchinson picked up a second yellow card midway through the half.
Grabban twice went close before Kermogant came within a whisker of sealing the win but the striker’s curling free kick was expertly parried onto the crossbar by Kirkland.
But just as it seemed the hosts would take the plaudits, the Cherries were picked off on the break.
First, with four minutes to go, Michail Antonio raced upfield and smashed against the crossbar and Best was on hand to control the rebound and place calmly past Camp.
Then, deep into added time, Best broke and looked up to find Maguire in space and the latter clipped a perfect pass over the advancing Camp and in.
Bournemouth: Camp, Francis, Cook, Elphick, Harte (Smith 70), Ritchie (Fraser 62), Surman, O'Kane, Pugh (Pitman 80), Kermorgant, Grabban
Owls: Kirkland, Buxton (Palmer 51), Onyewu, Llera, Mattock, Antonio, Lee, Hutchinson (sent off 64), Helan, Maguire, Nuhiu