The visitors were soon reduced to 10 men for the final half hour when Adrien Silva picked up a second yellow card for a reckless challenge.
Milan made hard work of finding a way back into the game until Hauge's pinpoint finish in the 87th minute, and midfielder Franck Kessie's deflected strike came back off the post in stoppage time.
Milan have not won on their own ground since beating bottom side Crotone on Feb. 7, a run of six games in all competitions that marks their worst home form since December 2013.
A point does little for the Rossoneri's fading Serie A title hopes, as it left the second-placed side five points behind leaders Inter, having played two more games. Sampdoria remained 10th with 36 points.
Despite fielding a near-full strength side, Milan went in at the break having failed to register a shot on target for only the third time this season.
Hernandez's slack pass fell into Quagliarella's path in the 57th minute and the 38-year-old guided in a first-time lob to reach 10th league goals for the season.
Silva's poorly-judged slide tackle left his side a man down two minutes later, but Milan could not find a breakthrough until Hauge curled a shot into the far corner.
Kessie was inches away from completing a remarkable turnaround when his finish was deflected off the post in the dying minutes.