The game came to life just after the half-hour mark and it was Cardiff who were asking all of the questions, Pilkington forcing a save out of Green from an acute angle in the 32nd minute.
The Hoops had the chance to double their advantage two minutes later as Chery ventured forward again and played a lofted pass into the box, narrowly missing the head of Charlie Austin.
After dominating the early stages, Cardiff found themselves on the ropes and were glad to hear the half-time whistle after two minutes of stoppage time.
Cardiff looked in control once more as the second period got under way, but they were pegged further back against the run of play in the 57th minute.
Hill got his head to another corner, nodding the ball on for Austin to scramble home from close range with what looked suspiciously like his hand.
The Bluebirds gave themselves a lifeline in the 64th minute with the third set-piece goal of the evening, Sean Morrison beating Hill to a corner to nod Cardiff back into contention.
QPR had the opportunity to put the result beyond doubt just a few moments later, but Austin was denied from close range as Matthew Connolly blocked the effort on the line to send the ball against the post and away to safety.
Despite Cardiff continuing to dominate possession in the closing stages, there was time for both sides to attack late on as Matt Phillips raced clear to force Simon Moore into a fine save.
It was a stunning finish to a dramatic match as the ball dropped to Malone, who left Green helpless by finding the top corner with a fine half-volley from outside the box.