For top 5 I would include the five who had the greatest effect on the musicians who followed after them. If you take out any of my five recommendations, most likely every single 20th century classical writers output would be impacted.
The one who stood at the epicenter of music development was Bach. His works are mathematical perfection.He is the only Western composer whose works are considered as registering on the classical musical scale among the classical Indian musicians. (Musical theory, and instrument development in India has preceeded Western music by many centuries, so it's not a little accomplishment to be acclaimed and accepted by the East.)Before Bach people have not understood the mathematical background of music so profoundly, and after Bach, they overcomplicated things, and by doing that, they also took away from the mathematical balance that Bach has achieved. Western music history in a nutshell: striving towards perfection of harmony and balance, reaching it with Bach, then loosing it again by overcomplication since Bach.
While Bach's works were lost soon after his death, many of his contemporaries were deeply affected by him - Handel, Haydn, Beethoven all were influenced by him, just as other musicians of his era.Mozart would be the second giant, with Beethoven and Haydn. Of these four, there's not doubt that they had a profound influence on Western classical music. Fifth would be.... well, hard to tell. There were so many after Beethoven and Haydn that it's impossible to pick on definitive giant who influenced everyone after him. I'd rather go back in time, to before Bach, and pick Claudio Monteverdi, a giant who made a huge turn on the wheel of music: polyphonic music, opera, and huge advances in form and melody. Without him, we would be still stuck at early Baroque, and there would not have been a Bach...
So, I would recommend:Monteverdi,Bach,Haydn, Mozart, Beethoven. (In order of birth...)Top two, without shadow of a doubt, were Monteverdi and Bach - take them (or either of them) out of the picture and every other composers output would be drastically impacted. Contemporary music would be nothing like today.