The win moved third-placed Atalanta to 64 points, four points ahead of Bologna who beat leaders Inter Milan 1-0 earlier on Sunday, while Milan remain ninth in the standings on 51 points.
The opening half saw Atalanta control possession but neither side created any real chances until just before the break when Milan’s Luka Jovic collected a pass on the turn in the box and put his shot just wide.
Milan were the more positive side after the interval, pushing forward but unable to find a way through and they were punished by a patient Atalanta in the 62nd minute.
Ademola Lookman’s cross into the area was met by Raoul Bellanova with a deft headed pass back to Ederson who finished off the move with a diving header past keeper Mike Maignan.
That goal appeared to take the wind out of Milan’s sails and Lookman was the danger man as Atalanta strived for a second goal, having one shot blocked by Youssouf Fofana and another deflected for a corner.
Lookman then played a ball across the goal which Mateo Retegui somehow put wide from inside the six-yard box when sliding in under pressure from Milan defender Strahinja Pavlovic.
Milan substitute Joao Felix did well to gather the ball and drive forward towards the Atalanta area but then completely scuffed his shot and Lookman had another chance after a run from his own area but Maignan saved his effort.
The final whistle was greeted by loud cheers from the away fans who had travelled in numbers from nearby Bergamo, and jeers from the home crowd who again spent much of the game protesting against the Milan hierarchy.