Jaden Philogene's sharp finish claimed a much-needed win for Cardiff City at home to Rotherham United.
Fresh from a derby humbling at Swansea City and hovering near the drop zone, Cardiff were in control but lacked a cutting edge until Philogene's arrival.
Fellow half-time substitute Mahlon Romeo picked out Philogene who shifted the ball cleverly to find the net.
It was no more than the Bluebirds deserved against a Millers side who failed to register a shot on target.
Rotherham arrived at Cardiff City Stadium a little deflated from conceding a last-minute penalty at Coventry City in midweek, which Viktor Gyokeres had converted to rescue a 2-2 draw for the struggling Sky Blues.
But that was nothing compared to Cardiff's hurt after last Sunday's south Wales derby humbling, losing 2-0 at rivals Swansea City - the first time either side has lost three successive league derbies since the clubs' first meeting in 1912.
Any plan Bluebirds interim manager Mark Hudson, who took over following Steve Morison's sacking in September, may have had to best Swansea went out the window after just seven minutes due to Callum Robinson's petulant red card.
That also meant Hudson was without the services of his suspended striker against Rotherham, as he looked to end a run of three successive league defeats that left them teetering a point above the relegation places.
It has been the toughest of auditions for Hudson - with only Paul Trollope making a worse start to his managerial time in charge - as he looks to claim the role permanently, with the Cardiff City hierarchy still pondering its next move.
Matt Taylor's Rotherham started the day looking far more comfortable in 12th, although the eight places difference between them and their hosts was only courtesy of four points.
Cardiff had the ball in the net within two minutes only for the offside flag to deny Sheyi Ojo, stroking in a rebound after Mark Harris' cheeky backheel give-and-go with Callum O'Dowda had allowed Harris a shot at goal.
O'Dowda was the next to have a sight at goal, picked out in the left channel by Joe Ralls - sporting a captain's armband supporting the Rainbow Laces campaign - but his shot could only graze the netting behind the top of the post.
Rotherham struggled to make much impact in the opening half-hour, with Connor Washington unable to capitalise on the most promising chance as the Millers counter-attacked from a Cardiff corner.
Ojo should have had the ball in the net for the second time, and this one would have counted, but a metre out from goal somehow managed to miss his header after O'Dowda popped up on the right to find space and cross invitingly.
The Bluebirds kept up the pressure and Ryan Wintle saw his goal-bound effort cannon off a defender to spiral away for a corner, before Andy Rinomhota put Harris through to shoot from a tight angle - with Viktor Johansson in the Rotherham goal getting his near-post positioning right.
The half-time stats told the story clearly, with Cardiff enjoying 64% possession and nine shots at goal, three of which were on target. Rotherham one shot, none on target.
Hudson made two changes for the second half, both full-backs Tom Sang and Niels Nkounkou making way for Romeo and the more attacking Philogene as he matched up to Rotherham's nominal three at the back.
Cardiff's wing-backs, however, were prepared to push forward and the attacking intent created a flurry of early chances for the Bluebirds.
That in turn allowed Rotherham to find a little more space and Cardiff keeper Ryan Allsop was finally able to warm his hands by plucking a low cross out of the air.
Rotherham suffered an injury blow when defender Cameron Humphreys went down awkwardly and was eventually replaced by Brooke Norton-Cuffy as the hour-mark neared.
When the break-through came it was a combination of Hudson's half-time changes.
Ojo picked up a loose ball in midfield and spread it right to the overlapping Romeo, who had his initial cross blocked but collected the rebound to find Philogene in the box.
The Aston Villa loanee wrong-footed three Rotherham defenders, turning back on his right foot to dig out a sweet finish inside Johansson's left post.
The excellent O'Dowda almost conjured a second Cardiff goal when his low cross skewed up off the diving Johansson, but the ball just evaded the lurking Harris.
When a Rotherham corner fell nicely to Norton-Cuffy the defender had a chance to level against the run of play but his shot lacked conviction and curled away with the Cardiff defence, for once, back on its heels.
Wintle should have made the points safe after Harris picked him out at the back post but the midfielder blasted his shot well over the crossbar with the goal gaping, but Rotherham could not find a late reply to spoil Cardiff's afternoon.
Cardiff City: Allsop; Sang (Romeo 45), Ng, Kipre, Nkounkou (Philogene 45); Wintle, Ralls (C), Rinomhota (Sawyers 62); Ojo (Whyte 88), Harris (Etete 90), O'Dowda. Subs not used: Alnwick, Simpson.
Rotherham United: Johansson; Peltier, Wood (C) (McCart 77), Humphreys (Norton-Cuffy 58); Harding, Wiles, Barlaser, Rathbone (Lindsay 71), Bramall; Kelly (Eaves 71), Washington (High 77). Subs not used: Vickers, Odoffin.