The French Open Champion lost 3-6 6-4 7-6 (6-4) to the Canadian to become the youngest player to reach a Masters 1000 quarter-final.
The win for the 18-year old Canadian means he will battle it out with Frenchman Adrian Mannarino.
Rafael Nadal would have claimed top spot from Andy Murray had he reached the semi finals but with the loss suffered to Shapovalov, the British will still hold on to the number one spot on the ATP Rankings.
Elsewhere Swiss Rodger Federer continued his fine form this year with a 2-1 win over Spaniard David Ferrer.
The Swiss and world number three beat Ferrer 4-6 6-4 6-2 to reach the next round and will face another Spaniard in the shape of Roberto Bautista Agut who saw off Gael Monfils from France 4-6 7-6 (7-5) 7-6 (6-2).
Rafael Nadal or Rodger Federer can reclaim top spot from Andy Murray if either are to reach the quarter finals at Cincinnati Masters next week.
German Alexander Zverev also reached the quarter finals after he eased past Nick Krygios from Australia 6-4 6-3 and will take on Kevin Anderson from South Africa who also swept aside American Sam Querrey 6-4 6-3 to reach the next stage.
The last quarter final pairing will see Diego Schwartzman of Argentina taking on Robin Haase of the Netherlands after beating Jared Donaldson 0-6 7-5 7-5. Haase also saw off Grigor Dimitrov 7-6 (6-3) 4-6 6-1 to reach the quarters.