The Championship side were two goals down against League One opponents on Monday night, but Jermaine Johnson and Chris O’Grady (2) – both former Oldham players – rescued them before Michail Antonio completed the win.
Oldham struck after just seven minutes when a fine move down the right ended with James Wesolowski crossing to Jordan Slew, who marked his debut by slotting in from eight yards at the near post.
Wesolowski went close from long range before Oldham doubled their lead after 26 minutes as Lee Croft delivered a pinpoint right wing cross and Jean Yves Mvoto thudded home an eight-yard header.
Wednesday wasted a glorious chance just before half-time when Croft brought down Antonio on the left of the box and the resulting penalty was blazed high and wide by Nejc Pecnik.
But, after visiting keeper Chris Kirkland saved well from Croft, Wednesday pulled one back after 53 minutes, Pecnik teeing up Johnson for an 18-yard shot which went through the dive of Alex Cisak.
The equaliser came eight minutes later as sub O’Grady headed Miguel Llera’s right-wing free-kick inside the far post from six yards.
And in the 70th minute Wednesday were in front, with O’Grady producing a neat turn and six-yard shot after Pecnik pulled back from the byline.
Antonio added the gloss three minutes from time, bending his shot powerfully into the far corner from just inside the box.