Michael Ricketts thrashed in a fierce drive to put City ahead but Stephen Foster nodded Crewe level before the break from Kenny Lunt's free-kick.
Joe Ledley headed Cardiff back in front and Kevin Cooper drilled in the third.
Darren Purse fired in a penalty after Alan Lee was fouled and Cameron Jerome blasted the fifth before Jason Koumas' top corner strike rounded off the win.
Cardiff manager Dave Jones:
"After 20 minutes we should have put the game out of their reach but didn't and I had to let my players know how I felt. "We took our foot off the gas midway through the first half which gave them hope but we lifted ourselves.
"I am really delighted for all the players."
Cardiff: Alexander, Weston, Loovens (Cox 45), Purse, Barker, Cooper (Parry 75), Ledley, Whitley, Koumas, Jerome, Ricketts (Lee 62).
Subs Not Used: Ardley, Margetson.
Booked: Purse, Lee.
Goals: Ricketts 18, Ledley 48, Cooper 60, Purse 67 pen, Jerome 68, Koumas 74.
Crewe: Williams, Moss, Foster (Higdon 73), McCready (Bignot 55), Tonkin, Billy Jones (Vaughan 45), Gary Roberts, Lunt, Varney, Rivers, Suhaj.
Subs Not Used: Steve Jones, Tomlinson.
Booked: Moss, Foster.
Goals: Foster 31.
Att: 10,815
Ref: M Russell (Hertfordshire).