Marcel Hirscher won at Madonna di Campiglio following a dramatic finish that saw him narrowly beat Luca Aerni.