Nadal will face Stan Wawrinka in the round of 16 after the Swiss rallied to beat Hungarian Marton Fucsovics 1-6 7-6 (2) 7-6 (10).
In a match which began slightly late due to heavy overnight rain which continued into the morning, ninth-seeded Wimbledon champion Djokovic repeated a victory he scored over the Canadian at the same tournament in 2009.
Four-time champion Novak Djokovic advanced to the third round of the Rogers Cup on Wednesday, beating Canadian wild-card Peter Polansky 6-3, 6-4.
"I thought I served well in the moments when I really need it", the Serbian star said.
Nadal, playing for the first time since a five-set loss to Djokovic in the Wimbledon semifinals, topped France's Benoit Paire 6-2, 6-3 at night after a series of rain delays.
World number one Nadal, who kicked off the evening session a little over an hour after its original start time, had some issues with his serve later in the match but still needed only 74 minutes to secure his spot in the third round. Overall my game was so-and-so.
Greece's Stefanos Tsitsipas set up a match against Djokovic, knocking off seventh-seeded Dominic Thiem of Austria, 6-3, 7-6 (6).
Tsitsipas, who turns 20 on Sunday, relied on his serve and forehand combination to get by Djokovic, who was competing in his first tournament since collecting his 13th grand slam title at the All England Club last month.
Del Potro wrote on Twitter that his wrist "needs some days of rest".
Del Potro had a bye into the second round and was scheduled to face Dutchman Robin Haase.
Karen Khachanov upset 12th-seeded Pablo Carreno Busta 6-4 7-6 (7-3), Ilya Ivashka toppled Ryan Harrison 7-6 (7-5) 6-4 and American Frances Tiafoe edged Canada's Milos Raonic 7-6 (7-4) 4-6 6-1.
The Argentine, who looked to be in good form after reaching the final last week in Los Cabos, was replaced in the draw by Russian veteran Mikhail Youzhny.