Such has been AC Milan's reliance on Il Faraone this season, it was just as well he got back to his scoring ways, not least in such a closely-fought encounter as this.
It was the hosts who were the most dangerous in the opening moments, and Giacomo Bonaventura forced Christian Abbiati into the game's first save with a tricky cross. The veteran keeper was called into action shortly after, making a one-handed stop to keep Germán Denis' attempt out.
El Sharaawy was Milan's most dangerous attacking threat, though was frustrated by the determined Atalanta defending. Eventually, he broke the deadlock, firing in on the turn before driving past Andrea Consigli.
Despite their lead, Milan were unconvincing -- though that's not to say they ever look too convincing. Atalanta were practically camped in the opposition's half, playing cross after cross into the area. Abbiati was flapping like an angry walking-stick wielding pensioner, though thanks to some profligate finishing from Denis and Facundo Parra, Milan survived until the break.
The second half saw the game becoming increasingly scrappy, and Davide Brivio paid the price with a second yellow card on the hour. The Nerazzurri didn't seem overly perturbed, though Milan had a chance when Mbaye Niang pounced on a rebound from Mathieu Flamini, though his shot was blocked too.
Flamini should have sealed it when sent clear on Consigli's goal, though the goalkeeper made a good save at his near post. As frustrated as the home fans, Atalanta coach Stefano Colantuono was sent from the technical area in the dying moments, before Carlos Carmona was booked for a blatant dive in the area.
The win sees Milan move up to fifth, just a couple of points behind Inter ahead of their game with Torino tonight, while Fiorentina's loss to Catania means they fall to sixth. Atalanta, in 14th, are five points clear of the relegation zone.
Atalanta (4-3-1-2): Andrea Consigli; Davide Brivio, Michele Canini, Guglielmo Stendardo, Michele Ferri (Cristian Raimondi 24); Davide Biondini, Luca Cigarini, Carlos Carmona; Giacomo Bonaventura; Facundo Parra, Germán Denis
AC Milan (4-3-3): Christian Abbiati; Kévin Constant, Cristián Zapata, Philippe Mexes, Ignazio Abate; Kevin-Prince Boateng, Riccardo Montolivo, Mathieu Flamini; Stephan El Shaarawy (Robinho 85), Giampaolo Pazzini, Mbaye Niang (Bakary Traore 89).
Goals: El Shaarawy 29 (M)
Red Cards: Brivio 59 (A)