McAteer appeared to strike out with a knee at his opponent after a dreadful challenge two minutes into stoppage time at the end of a game in which Stojkovski's two first-half penalties had given the hosts the lead.
The Italian referee Alfredo Trentalange showed the red card to both men after players from each side rushed to the scene and were joined by coaches from both benches.
Macedonia had previously beaten only Liechtenstein and Cyprus in their six years as an international side and this was by far their biggest moment of triumph.
It had all started so well for Mick McCarthy's men as Alan McLoughlin headed home in the eighth minute. But 20 minutes later Stojkovski stunned them with a penalty equaliser following a handball against McAteer, and he scored from the spot again in the final minute of the first half after Terry Phelan was adjudged to have handled a fierce drive by winger Vlatko Gosev, launched just five yards from his face.
After the interval, substitute Keith O'Neill and McLoughlin had good chances, but disaster struck again just before the hour when Ian Harte, another substitute, lost his footing as he tried to stop Artim Sakiri, who slipped the ball through for Georgi Hristov to blast in off the bar.
In the 78th minute David Kelly, on the field for three minutes, turned the ball into a vacant goal after Jon Goodman had latched on to Steve Staunton's long pass. But further frenzied efforts were all to no avail and led only to that bad-tempered conclusion.
McAteer will now face suspension and Roy Keane completed a bad afternoon for the Irish by collecting a yellow card for diving in search of a penalty in the closing stages.
MACEDONIA: Celeski (Macedonia Skopje); Milosavov (CSKA Sofia), Stojkovski (Real Oviedo), Markovski (Vardar Skopje), Nikolovski (Royal Antwerp), Sedloski (Hajduk Split), Gosev (Sileks Kratovo), Glavevski (Vejle BK), Hristov (Partizan Belgrade), Sainovski (Vardar Skopje), Sakiri (Hamlstad). Substitutes: Beganovic (Sloga Jugomagnat Skopje) for Hristov, 79; Georgievski (Balkan Bisi Skopje) for Sainovski, 82; Micevski (Mechelen) for Glavevski, 87.
REPUBLIC OF IRELAND: A Kelly (Sheff Utd); Irwin (Man Utd), Phelan (Everton), McAteer (Liverpool), Breen (Coventry), Keane (Man Utd), Townsend (A Villa), McLoughlin (Portsmouth), Cascarino (Nancy), Goodman (Wimbledon), Staunton (A Villa). Substitutes: Harte (Leeds) for Phelan, 56; O'Neill (Norwich) for Cascarino, h-t; Kelly (Sunderland) for O'Neill, 75.
Referee: A Trentalange (Italy).