Spoils were shared in Bologna.
The home team took the lead thanks to Castro before going one man down after Lucumí got sent off.
The Nerazzurri, denied twice by the woodwork, hit the back of the net with a stunner from Samardžić, on his scoring debut with the Atalanta shirt.