Ben Williams made a fine save to deny Neil Harris early on at the Community Stadium but Millwall took the lead two minutes before half-time through Steve Morison.
He beat Franck Queudrue to Millwall goalkeeper David Forde's long punt forward and advanced towards goal before firing low past U's goalkeeper Ben Williams.
But Forde turned villain four minutes into the second half when he dropped Williams' long clearance, allowing Kevin Lisbie to slot into an empty net.
Chris Hackett's shot whistled narrowly wide for Millwall and United substitute Danny Batth cleared Darren Ward's header off the line.
But substitute Shaun Batt's cross hit Batth and flew into the empty net with 12 minutes to go and Williams saved well from substitute Jon Obika late on, as the Lions claimed a precious three points.