The FA Cup finalists seemed to have Wembley on their minds for long periods of a game that started in low key fashion.
But veteran striker Jimmy Floyd Hasselbaink fired them in front on the stroke of half-time following good work by Joe Ledley.
It was his first goal in the league for more than two months and he should have doubled his tally in the opening minute of the second half when he fired against the inside of the post with just goalkeeper Joe Murphy to beat.
That miss proved costly as Scunthorpe came roaring back to take command with two quick-fire goals.
They equalised in the 53rd minute when striker Paul Hayes flicked a near-post corner from Ian Morris past goalkeeper Peter Enckelman from close range.
Three minutes later, Hayes then became the provider with a great ball into the box for winger Kevan Hurst to pick his spot past Enckelman for his first goal for the club.
Cardiff were stunned and quickly fought back onto level terms when Ledley had time on the edge of the box to pick his spot into the bottom corner with a 59th minute equaliser.
With the game in the balance, Cardiff pushed forward in search of the winner they needed to keep their play-off hopes alive.
But despite a period of strong pressure they could not find their cutting edge in front of goal.
Instead it was Scunthorpe who snatched a dramatic late winner when Hayes converted from the penalty spot in the second minute of stoppage time after full-back Marcus Williams had been brought down by a challenge from Glenn Loovens.
It was the first defeat in ten games for Cardiff and manager Dave Jones fumed after the final whistle that his side had been kicked off the park by Scunthorpe, with referee Phil Joslin failing to protect his side.
"This was the worst display of refereeing I have seen for a long time," he claimed.
"My players are entitled to expect some protection which they did not get."