Automatic promotion-chasing Cardiff edged out Barnsley as the visitors gave it everything against a side who look to be bound for a return to the Premier League.
The Reds created a number of chances during an entertaining 90 minutes, but only had Oli McBurnie’s predatory second-half strike to show for their endeavours.
Both goalkeepers were kept busy as the visitors gave a terrific account of themselves despite the final result.
Recently appointed boss Jose Morais had made three changes to his starting line-up for the arduous midweek trip to south Wales.
All alterations came across the defence following the Reds’ previous fixture at Hull City seven days earlier, which ended 1-1.
Ethan Pinnock replaced KC Stadium head injury victim Adam Jackson at centre-back, while at right and left-back, Andy Yiadom and Zeki Fryers replaced Dimitri Cavare and Daniel Pinillos respectively.
The in-form Bluebirds enjoyed the better of the early exchanges as Neil Warnock’s men were chasing a fifth straight victory.
Former Reds loanee Kadeem Harris was particularly lively and he fired into the side-netting early on.
The visitors replied with Brad Potts seeing a crisp drive saved well by Neil Etheridge, but Cardiff kept their foot on the pedal.
Nick Townsend was called upon to make a breath-taking save after 18 minutes, denying Craig Bryson from close range.
Harris again went close to an opener minutes later.
The Reds then fluffed a terrific opportunity midway through the opening period.
Potts made a great run down the flank and crossed for midfielder Gary Gardner, but he somehow managed to divert his header wide from three yards out.
Again the Bluebirds responded swiftly, with Townsend again in inspired form as he saved Kenneth Zohore’s effort from just outside the box.
Morais’s men will have known in advance they were facing a huge task, and after half-an-hour that was proving to be the case.
The hosts grabbed the goal they had been threatening in the 31st minute.
It was Callum Paterson who struck from 10 yards after being neatly teed up by Zohore.
Credit to the battling Reds as they almost responded within two minutes as Potts’ well-struck effort only just flew past the post.
Seconds before the interval Kieffer Moore’s header - from Mamadou Thiam’s pinpoint cross - drifted narrowly wide.
The Reds’ prospects took a major nosedive just two minutes into the second half as Cardiff’s Serbian midfielder Marko Grujic curled home expertly to make it 2-0.
Again, though, the visitors responded swiftly. Within the next five minutes McBurnie screwed a close-range shot just wide and Thiam slammed an effort into the side-netting.
The small pocket of noisy Reds fans certainly hadn’t given up hope, but it looked as though the Bluebirds were homing in on another victory as the hour mark approached.
Just past that point there was hope for the Reds faithful as McBurnie pounced to halve the deficit, darting in to convert a Yiadom cross.
That deficit was almost wiped out when Etheridge made superb stops from both McBurnie and Moore.
The Reds rally didn’t last, and Morais’s men were still chasing a second goal as the final five minutes beckoned.
Cardiff almost made it 3-1 late on as sub Nathaniel Mendez-Laing curled a shot against the post.
The Reds hit the road for the fourth consecutive match on Saturday as they head north to Middlesbrough. Cardiff (4-4-2): Etheridge; Connolly, Manga, Bamba, Bennett; Bryson, Grujic (Halford, 56), Paterson (Damour, 61), Hoilett; Harris (Mendez-Laing, 70), Zohore.
Subs not used: Murphy, Feeney, Pilkington, Wildschut.
Barnsley (4-3-3): Townsend; Yiadom, Pinnock, Lindsay, Fryers; Potts (Bradshaw, 85), Williams, Gardner (Knassmullner, 46); Thiam (Hedges, 74), Moore, McBurnie.
Subs not used: Davies, Pearson, Cavare, Mahoney.
Referee: Robert Jones (Merseyside).
Star man: Oli McBurnie.