Second-half goals from Will Vaulks and Callum Paterson earned Cardiff a 2-0 win at Barnsley that boosts their hopes of reaching the Sky Bet Championship play-offs.
However, the result leaves Barnsley with a real battle to avoid relegation over the final leg of the season.
Barnsley started the game five points from safety after losing at Reading last time out while Cardiff began five points off the top six.
Tykes striker Cauley Woodrow fired in a firm drive which flashed wide of Alex Smithies' right-hand post but apart from that it was a quiet opening, with neither keeper tested early on.
Barnsley's Michael Sollbauer was able to continue after receiving treatment following a collision inside his own area.
Cardiff's Dion Sanderson headed away as Jacob Brown looked to get on the end of a cross.
In the home side's next attack, Luke Thomas cut inside from the right wing and tried an angled shot which went beyond the far post.
Cardiff's first effort of note came when Albert Adomah broke free on the right-hand side of the area and fired in a shot which Brad Collins did well to beat away at his near post.
The resulting corner was met by Sanderson, who put his header over.
Soon after the restart, Sean Morrison's flick-on was met by Paterson, whose tame header was comfortably gathered by Collins. At the other end, Marcel Ritzmaier put a shot wide.
The visitors had a great chance when Joe Ralls sent over a low cross to Junior Hoilett, who lifted the ball over from a good position.
Cardiff had an appeal for a penalty turned down when Paterson appeared to be felled in the area by Collins.
Vaulks put the visitors ahead in the 65th minute, firing into the net following a goalmouth scramble after Adomah caused problems for the Barnsley defence.
Paterson added a second goal a minute later when he received a through-ball from Morrison, went one-on-one with Collins and slipped the ball past the oncoming keeper.
Barnsley boss Gerhard Struber sent on Elliot Simoes in place of Brown in a bid to add a fresh attacking dimension to his side.
Thomas had a shot which was deflected off-target before Struber made another attacking change, with Patrick Schmidt taking over from Conor Chaplin.
The substitutions failed to have the desired effect, however, with Barnsley never threatening to force their way back into the game.