Milan, who are chasing a first title in 11 years, went ahead in the fifth minute with a strike from Brazilian attacking midfielder Junior Messias after he had been released by full back Theo Hernandez. Salernitana pulled level in the 29th minute through striker Federico Bonazzoli and then took a surprise lead in the 72nd with a diving header from Bosnian forward Milan Djuric.
The home side's euphoria did not last long, however, as Croatian midfielder Rebic let fly with a low shot from outside the box which skidded into the far bottom corner of the net.
The draw meant Milan failed to extend their lead at the top of the table and they sit on 56 points after 26 matches, two ahead of neighbours and champions Inter Milan, who have two games in hand and can regain top spot when they host Sassuolo on Sunday.
Salernitana stayed rooted to the foot of the table but moved on to 14 points.
"The fact we fought back for a draw is positive but we came here for a win. We are disappointed because we didn't play our usual football," said Milan coach Stefano Pioli.
"We did not play well technically and made some bad choices with the ball. Our passing was sloppy and we were too hurried and paid a big price for the errors we made, which were naive."