Referee Andy Haines pulled the game back 50 yards after his assistant spotted an off-the-ball incident and Neil Harris calmly converted from the spot.
Oldham were furious with the decision and almost went 2-0 down as Steve Morrison hit the post and Lewis Grabban's follow-up shot was saved. But the result was rough justice on Oldham after they dominated long spells and created a string of chances.
Keigan Parker squandered a clear opening after five minutes when he blazed over from close range, while Deane Smalley and Pawel Abbott also missed the target.
Smalley was guilty of firing wide from six yards and Millwall keeper David Forde made a good save to turn away Abbott's angled drive.
Oldham, the lowest scorers in League One, were the better side but they were rocked by the controversial penalty which Harris tucked in after 57 minutes. Smalley misfired again but Millwall held on with resolute defending to wrap up their second away win of the season.