Morecambe's Kevan Hurst cancelled out John Johnson's opener for Northampton, who regained the lead through Kevin Thornton only for James Spencer to level again.
Leon McKenzie converted a 71st-minute penalty after Morecambe's Andy Parrish had handled, but Morecambe substitute Paul Mullin converted an 88th-minute leveller.
McIlroy said: "Who'd want to be a football manager after a game like that? We saw the best and worst of Morecambe, but to come back three times was fantastic.
"We keep giving ourselves a mountain to climb and we did again. Our defending was awful and we gave away goals far too easily.
"But we kept going to the end and got our just rewards. This is always a hard place to come, but once we equalised the third time I thought we might go on to win it."
Source: PA
Source: PA