Former Sunderland academy player Jak Alnwick kept his old club at bay before Mark McGuinness headed home a late winner to snatch a 1-0 victory for improving Cardiff.
The 30-year-old goalkeeper, who left the Black Cats to join Newcastle in 2008, made a string of fine saves to frustrate Tony Mowbray's men.
And with three minutes remaining centre-back McGuinness headed in the only goal of the game to make it four wins from five for the Bluebirds.
That was enough to bring an end to Sunderland's five-match unbeaten and they remain fifth in the Sky Bet Championship standings.
Cardiff, who move up to seventh, had a couple of earlier half-chances but this was a fixture when they were thankful to Hexham-born Alnwick for keeping them in it.
Mowbray named an unchanged team in a bid to continue the excellent run of form but Cardiff, under former Fenerbahce boss Erol Bulut, have enjoyed recent positivity too after a slow start to the season.
Cardiff were set up to frustrate, with the home side quick to enjoy plenty of possession in the opposition's half.
But chances were few and far between early on at the Stadium of Light, where Friday's England Women's Nations League win over Scotland pushed back this fixture by 24 hours.
After Karlan Grant had fired over from distance for Cardiff, Sunderland started to get more joy at the other end and should have taken the lead 22 minutes in.
Just minutes after Jobe Bellingham had headed into the arms of Alnwick, the goalkeeper looked beaten when Alex Pritchard side-footed towards the bottom corner.
But Cardiff defender Dimitrios Goutas' touch was enough to take the effort inches wide of the upright after some clever play from Abdoullah Ba and Bellingham down the left created the opportunity.
Even though Sunderland had to be aware of Cardiff's counter-attacks, Jack Clarke was next to go close when he skipped past two men and forced Alnwick into a low stop before half-time.
The flow of the game continued that way after the restart. Alnwick was again on hand low to his right to stop Pritchard's drive from the edge of the area after a lovely move also involving Mason Burstow and Clarke.
While goalless the door was always open for Cardiff and Ike Ugbo turned and shot over after the visitors created a promising opening when Burstow was dispossessed on halfway moments after he was cautioned.
Sunderland kept pressing and Clarke's excellent run and pass was followed by Alnwick saving from Patrick Roberts' first-time effort, while fellow substitute Adil Aouchiche's rebound was blocked by a defender.
Cardiff's Kion Etete forced Anthony Patterson into a stop after a mazy run through the Sunderland backline with 10 minutes remaining as the game suddenly opened up.
And the ideal away performance was complete when McGuinness arrived at the back post to nod Ryan Wintle's corner inside the bottom corner late on.
Sunderland: Patterson, Hume, O'Nien, Ballard, Huggins (Rusyn 88), Neil, Ba (Roberts 62), Bellingham (Aouchiche 63), Pritchard, Clarke, Burstow (Semedo 63).
Subs Not Used: Taylor, Seelt, Triantis, Bishop, Rigg.
Booked: Ba, Burstow.
Cardiff: Alnwick, Ng,Goutas, McGuinness, Collins, Wintle (Romeo 90), Siopis, Ralls (Adams 78), Meite (Rubin Colwill 64), Ugbo (Etete 63), Ahearne-Grant (Tanner 46).
Subs Not Used: Runarsson, Panzo, Rinomhota, Robinson.
Booked: Siopis, Rubin Colwill.
Goals: McGuinness 87.
Ref: Stephen Martin (Staffordshire).