Second-half goals from Peter Whittingham and Craig Noone gave Cardiff their first away win of the season at Millwall.
Whittingham had a first-half free-kick disallowed before he broke the deadlock with a superb 20-yard effort on 53 minutes.
Two minutes later Noone opened his account with a well taken goal from close range.
Millwall's James Henry saw his first-half free-kick saved by David Marshall.
Defeat at The Den leaves Kenny Jackett's side fourth from bottom of the Championship while Cardiff remain fifth, a point behind leaders Blackburn Rovers.
The victory was Cardiff's third successive win but their evening was marred by an injury to Nicky Maynard, who was stretchered off in the second half.
Despite losing 4-1 at Hull City, Millwall's side showed only one change with Alan Dunne in for the injured Paul Robinson.
Cardiff boss Malky Mackay also made a single change with Aron Gunnarsson replacing fellow Icelander Heidar Helguson while Craig Bellamy was rested.
Looking to make amends for the defeat at Hull, the home side started brightly.
James Henry's shot was blocked by Andrew Taylor before Nadjim Abdou's effort from inside the box was well saved by Marshall.
But Cardiff slowly got to grips with the game and they had the ball in the back of the net on 20 minutes when Whittingham's free-kick beat Maik Taylor.
But Whittingham was denied his fifth goal of the season as his effort was disallowed after referee Simon Hooper ruled that Gunnarsson had infringed in the build-up to the free kick.
Jordon Mutch and Maynard both saw efforts go wide while at the other end Karleigh Osborne went close.
And Cardiff keeper Marshall was forced to parry Henry's free-kick as Millwall finished a goalless first half strongly.
The deadlock was broken by Cardiff seven minutes after the interval and it was Whittingham who finally scored in spectacular fashion.
Cardiff's leading scorer found the top corner with a curled effort from 20 yards after receiving the ball from Noone.
Within two minutes the visitors had doubled their lead when Tommy Smith played in Noone and the former Brighton man fired past Taylor for his first Cardiff goal.
Cardiff were dealt a blow when Maynard suffered what appeared to be a serious knee injury which resulted in the ex-West Ham player being stretchered off.
Smith twice went close to extending Cardiff's lead while Noone's shot from the edge of the area was saved by Taylor.
Millwall introduced new loan signing Chris Wood during the second half but apart from a long-range Henry effort they could not prevent Cardiff from securing their first away win of the season.
Cardiff City manager Malky Mackay:
"This is a tough place to come. I've never had an easy game here and for us to score two goals again and keep another clean sheet away from home I was delighted with.
"I thought we scored a goal early in the first half, the free-kick. I could see nothing wrong with it.
"But it didn't unsettle us and we kept going and I thought second half we certainly came out playing some good stuff.
"I think the two pieces of quality calmed everything down and really settled the game."