Town are by far Division One's leading goalscorers but their leaky defence has conceded more goals than anyone else in the top half of the table.
Ipswich made an excellent start, and were two up inside nine minutes, both goals excellently struck long-range efforts from Tommy Miller.
Clayton Ince made a superb point-blank save to deny John McGreal before Crewe got one back on 35 minutes when Dean Ashton volleyed in off the bar from Kenny Lunt's cross.
Ince saved two more Miller drives before Kelvin Davis caught a stinging Neil Sorvel shot just before the break.
Two minutes after the interval, Crewe were level when Dean Ashton's low cross deflected in off McGreal for an own goal.
Town retook the lead when Shefki Kuqi rose above Ince to head in a Matt Richards cross, but Richards then deflected into his own net after Davis could only parry a Ben Rix shot.
McGreal almost headed a Lunt corner into his own goal before substitute Martijn Reuser put Town ahead with a superb dipping shot from way out on the right wing.
Fifteen minutes from time Town looked to be safe when Ince pushed a 20-yard drive from Pablo Counago into his own net.
Still Crewe were not beaten, and on 83 minutes two of their substitutes combined to make it 5-4 - Paul Edwards flicking on for James Robinson to score.
Billy Jones was denied an equaliser a minute later by a good Davis save, before Town finally sowed up the points two minutes from time when Kuqi broke clear and coolly curled an angled shot passed the hapless Ince.