The home side started brightly and deservedly took the lead when Adel Taarabt burst past Thomas Vermaelen and fired home in the 22nd minute.
The Gunners drew level in the 37th minute when Theo Walcott showed good composure to find the net after his first shot had bounced back off the post.
But Samba Diakite’s first goal for QPR in the 66th minute sealed a vital victory for Hughes’ men, who drew level on points with 17th-placed Blackburn Rovers.
“I was really proud of the players today,” Hughes told QPR’s website. “We worked hard all week on what we felt we needed to do against a side who in recent weeks have been the best in the Premier League.
“I felt if we could go into the game with confidence and belief we’d have a chance. I thought we were exceptional from start to finish.
“We scored two good goals at good times and man for man each and every one of them delivered for us.
“The discipline and resilience we showed to see the game out was very pleasing.
“We had a fantastic night here against Liverpool but this was even better. This was our best yet. The manner of our performance was superb.”
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news