No.1 seed Alexander Zverev ended Alexei Popyrin's Canadian Open title defence in a three-set thriller.