DJ Campbell found the net with a clear handball right at the end of the first half to give Ipswich a one-goal lead.
Cardiff had the first real chance when Mark Hudson was left unmarked as Peter Whittingham sent over a free kick but the centre-back couldn't divert his back-header goalwards.
Ipswich then perhaps should have taken the lead when new Ipswich loan signing Campbell was picked out by Aaron Cresswell but his volley on-the-stretch wasn't on target.
The hosts were dominating the ball and they again came close when Jay Emmanuel-Thomas let fly from long range and was denied by David Marshall's left hand.
Daryl Murphy's header from two yards under pressure then struck the post following a penalty-box melee as Ipswich continued to search for the opener.
The Tractor Boys went ahead in stoppage time when Lee Martin broke clear down the left and crossed for Campbell, who pushed the ball over the line with his hands and wasn't penalised.