Nahki Wells scored a hat-trick as QPR began the new year with a 6-1 mauling of Cardiff.
Will Vaulks scored a consolation goal for Cardiff with the final kick of the game.
It all came together for Rangers after a troubled spell in which they lost three of their past four matches and won just two of the previous 13.
It was also a stunning way for Wells to end his drought after nine matches without a goal – a run stretching back to November.
Eze set up the opener on nine minutes, picking the ball up near the left-hand edge of the halfway line and delivering a brilliant diagonal ball towards Wells, who drifted behind Sol Bamba and headed home.
Cardiff almost equalised when Aden Flint headed against the bar from a corner by former QPR man Junior Hoilett.
But the home side continued to threaten and almost went further ahead following one of a series of well-worked moves.
Ilias Chair played a delightful reverse pass through to Osayi-Samuel, whose pull-back from the right was hacked over the bar at the far post by an off-balance Eze.
The story of Rangers' season so far has been one of dropped points despite having large amounts of possession and chances – and it seemed like a familiar tale was unfolding.
But they got the all-important second goal, with Wells turning provider by setting up Osayi-Samuel with a clever chipped pass on 27 minutes.
Osayi-Samuel finished emphatically from a tricky angle, waiting for the ball to bounce before volleying beyond keeper Neil Etheridge and into the far corner.
Osayi-Samuel was a constant problem for Cardiff's ragged defence and struck again four minutes before the interval.
Keeper Joe Lumley, who kept his place despite a number of mistakes, including a costly error in the home defeat by Hull two days ago, superbly released the winger with a quick clearance.
Osayi-Samuel was involved in the fourth, scored a couple of minutes into the second half.
He got the better of Richards on the flank and sent a low cross towards Eze, whose mishit shot bounced up off the ground and was nodded in by Wells from close range.
Eze made no mistake in an almost identical situation in the 58th minute, this time when Chair breezed past Curtis Nelson and teed up the England Under-21 international for a simple tap-in.
Wells completed his hat-trick in the 64th minute with the help of a dreadful mistake by Flint.
The striker gratefully collected Flint's misplaced pass to Nelson and side-stepped Etheridge before scoring into an unguarded net.
It capped a wonderful day for QPR, who completed the final 12 minutes with 10 men after Toni Leistner limped off.
Cardiff's miserable afternoon was summed up by an embarrassing late miss by Lee Tomlin, who scooped the ball over the bar from a couple of yards out, although Vaulks did find the net with a long-range effort in the final seconds.