Damion Stewart netted a dramatic winner as QPR stormed back from 2-0 down.
Troubled Rangers went close when Wayne Routledge hit the post, before Gavin Mahon headed into his own net from Etienne Esajas' cross.
Marcus Tudgay put Wednesday further ahead with a penalty after Kaspars Gorkss brought down Leon Clarke.
But after Routledge set up Rowan Vine to pull one back, Mahon atoned for his earlier error by scoring with a diving header and Stewart headed home late on.
QPR caretaker coach Gareth Ainsworth:
"It was down to a fantastic bunch of lads in the dressing room.
"We dominated the first half and could have been three or four up. All the raised voices at half-time came from Sheffield Wednesday's dressing room.
"We kept calm, knew we were doing the right things and, although I had a little flutter at 2-0 down, I still had faith."
Sheffield Wednesday boss Brian Laws:
"We were fortunate to be two goals up. We started nervously and defended like a pub team.
"There were poor performances and they never stopped. Defensively that was the worst I've seen. It was like the Keystone Kops.
"If you do go 2-0 up you should never let it go like that. You could see the writing on the wall and it bitterly disappoints me."
Bookmark with:
What are these?