The Millers met stubborn resistance in a first half they dominated, but a second-half breakthrough looked like earning them maximum points before Porter netted the late spot-kick – which also saw Wes Harding sent off.
Chiedozie Ogbene blew a big chance to give Rotherham an early lead but he ballooned over after a marauding run from Ben Wiles.
Will Grigg then tested Alex goalkeeper Will Jaaskelainen with a glancing header from Joe Mattock’s cross and fired into the side-netting from Ollie Rathbone’s pass.
Crewe’s resilience was broken in the 54th minute when Rathbone charged down a clearance from Donervon Daniels and slotted the ball past Jaaskelainen.
The visitors snatched a point in the second minute of time added on as Porter smashed in from the spot after being hauled down by Harding, who received a second yellow card for the foul.