As time ticked away the keeper galloped up for a corner upsetting the United marking and allowing Hamed Namouchi to somehow bundle the ball over the line with his shoulder.
The game began in driving rain with Rangers without their key front man in the shape of the suspended Nacho Novo.
But it was one of the Tangerines' changes who made an impact from the outset as, low on confidence, United got off to a wonderful start in the 11th minute courtesy of comeback man David McCracken.
Following a poor clearance from a Mark Wilson corner kick the big defender, who had been dropped in recent games for some error strewn play, was on hand to powerfully head Derek McInnes's chip into the far corner of the net from 14 yards.
It could have been worse for the visitors if United had gone further ahead on the half-hour mark but the goal was chalked out for offside.
As Barry Robson's shot was heading into net, Jim McIntyre tried to make sure but he was ruled to be in an offside position by the far side official.
Without the recently departed Jean-Alain Boumsong in the centre of defence, the Rangers back four looked rather rocky at times and they were fortunate in the 38th minute when they were almost two down to a McIntyre header.
After sleeping through most of the half, United keeper Tony Bullock pulled off a superb save in injury time stopping the ball with his foot from Alex Rae's eight-yard shot.
The second half began in the same vein as first a McInnes' shot was well saved by Klos then Grant Brebner missed from only one yard out as he tried to react to McIntyre's flick on.
After their poor first-half display, the visitors tried to up the ante with pressure increasing on Bullock's goal.
But with 66 minutes on the clock, Robson had the ideal opportunity to extend United's lead but he shot straight at Klos with the goal gaping.
The visitors then thanked their lucky stars in the 74th minute when Robson's corner appeared to go straight in but the official signalled the ball had not gone over the line.
Despite Rangers' huff and puff they looked to be heading to defeat until the final minute when luck came their way.