It appeared that the encounter at Pride Park was heading for a 0-0 draw until veteran midfielder Carlos Edwards struck from distance in stoppage time to give visiting Ipswich all three points.
"We burgled it. I thought I heard the sirens and I said, 'Shut the doors, the police are coming!,'" McCarthy told reporters.
"Did we deserve the three points? Not on that performance because they were better than us."
The victory has moved McCarthy's men up to 14th in the Championship standings.