Ross Dyer's early opening goal had Stags fans dreaming of a third round tie against Liverpool for the second successive season, but four goals in a devastating 24-minute spell in the second half earned the Latics a trip to Anfield.
On a thoroughly miserable night for the League Two team, Ben Hutchinson and Sam Clucas were forced off through injury and skipper John Dempster was shown a straight red card late on.
"I thought for two-thirds of the game that we were in control," said Cox.
"We weren't under any pressure whatsoever and probably should have come in 2-0 up at half-time. (Sam) Clucas had a great effort what hit the post and could have probably done a little bit better.
"In the second half, their goalkeeper made a great save from Lindon Meikle and around the 60-minute mark I thought the game was very even.
"But we've got to be better. Our organisation and our structure has got us through the last two games, and 60 minutes in this game. At times you couldn't tell the difference between the two teams.
"Some of the lads said there were fouls in the lead up to two of their goals, but we've got to be stronger and our concentration levels have got to be better.
"I didn't see the 4-1 result coming because all we had to do was keep our shape and our organisation and more importantly, our discipline."
On the injury to Clucas, who was taken to hospital as a precautionary measure, Cox added: "I think Sam jumped and came down on the back of his Achilles, so I'm hoping he's alright."