The Bluebirds, who boosted their survival hopes by winning at Brighton last week, were second best at Craven Cottage in this fixture despite Fulham already being relegated.
Fulham scored a deserved winner in the 79th minute when Babel hit a wonderful drive from 25 yards, and Southampton's 3-3 draw at home to Bournemouth means Cardiff can only catch Brighton.
After Cardiff felt Aleksandar Mitrovic fouled Sean Morrison in the Fulham box early on, the Serbia striker's snapshot was beaten away by Neil Etheridge.
There was a lengthy delay as physios from both clubs attended to Denis Odoi after the Fulham defender appeared to be knocked out in a worrying collision with team-mate Maxime Le Marchand.
The half ended without a clear chance despite nine minutes of added time due to Odoi's injury, but Fulham should have led early in the second period when Mitrovic lifted a fine opportunity over.
Etheridge had to turn Tom Cairney's cross over his own crossbar as Fulham continued to press, with Joe Bennett's fine intervention then denying Joe Bryan a close-range strike.
An increasingly desperate Cardiff threw more players forward in the closing stages, but it was Fulham that broke the deadlock in sensational fashion.
Odoi's replacement Cyrus Christie made good progress down the right and when he fed Babel the Netherlands international arrowed an unstoppable strike across Etheridge.
Sergio Rico brilliantly tipped substitute Danny Ward's header over and Cardiff almost snatched a point in a frantic finale.
Junior Hoilett cracked the crossbar with a powerful drive before Morrison planted a free header straight at Fulham's goalkeeper in the fourth minute of stoppage-time.