The hosts were without their captain Marlon Pack from the start for the first time in the league this season, the midfielder dropping to the bench as one of five changes made by boss John Mousinho.
They started brightly, but it was Wednesday who had a huge chance to take the lead after 20 minutes.
Portsmouth defender Tom McIntyre failed to clear the ball effectively and passed it straight to the feet of Smith who was unable to force a shot on target, his effort blocked by a defender behind for a corner.
The Owls were then forced into an early change when Akin Famewo sliced a pass and waved to the bench right away, stopping play to receive some treatment and being replaced by Dominic Iorfa.
Portsmouth's Callum Lang forced a decent stop from Wednesday keeper James Beadle, curling a free-kick from 30 yards that was palmed away.
The hosts came inches from taking the lead when Lang had another free-kick that rebounded off the wall and looked to be trickling towards the line but Wednesday's Pol Valentin made a fine goal-line clearance to put it out for a corner.
From the resulting corner kick Portsmouth struck gold as the ball worked its way to Ogilvie who powered the ball home from a narrow angle to give his side the lead.
But the visitors found themselves level 10 minutes into the second half as Barry Bannan floated a pass towards Smith in the penalty area.
Smith headed the ball to the feet of Windass and the striker thumped it into the back of the net from six yards.
With just over 20 minutes remaining, Smith scored a screamer with his right foot to give his side the lead and send the 2,137 away supporters into chaotic celebrations.
He received the ball centrally from Yan Valery on the right and curled it past Jordan Archer for what will surely be one of the finest goals seen in the Championship this season.
Portsmouth pushed for an equaliser and the ball fell to Lang six yards out in the remaining seconds, but he struck over the bar to the frustration of the home crowd, some of whom booed their side at the full-time whistle.
Portsmouth boss John Mousinho told BBC Radio Solent:
"I’m disappointed, especially with the nature of losing after going a goal up into half-time.
"It was a contrasting performance from Tuesday night at Cardiff but ultimately we haven’t done enough to win the game and weren’t quite good enough to do it.
"I’m still really upset with the fact we lost it but there was a very different message to the players in the dressing room compared to Tuesday.
"That being said we still have to be a lot better."
Sheffield Wednesday manager Danny Rohl told BBC Radio Sheffield:
"It was a strong comeback after being 1-0 down.
"First half we were okay but we changed things at half-time. Coming from behind at Coventry and now here shows a step forward in our development.
"It's just three points, we climb the table eight places with a win but if you lose you drop down.
"But for me it's more important to improve and there is still room for that."