The 29-year-old forward, who spent the 2018-19 season with Turkish Super Lig side Fenerbahce on loan, was in brilliant form to help his side stretch their unbeaten run to five games this season.
The Ghana international set up Bersant Celina for the Swans’ opener in the 29th minute to ensure his side took the lead into the half-time break.
After the restart, Jordan Hugill levelled for QPR in the 66th minute before Borja Baston restored parity for Steve Cooper’s men four minutes later.
Ayew again shone, after he laid the pass for Sam Surridge which sealed victory for Swansea as they stretched their winning streak to three games.
The Black Stars skipper featured for 81 minutes before making way for Kyle Naughton while Anglo-Nigerian Bright Osayi-Samuel was on parade for the duration of the game but could not prevent his side from defeat.
With the victory, Swansea climbed to second spot on the Championship table with 10 points from four games.
They will play host to Birmingham City in their next league game on Sunday, August 25.