"You know it's going to be close, so it's about keeping disciplined and a positive attitude on the court," Raonic said.
World number four Raonic, forced out of the Davis Cup this month with a thigh injury he suffered during the Australian Open, broke del Potro in the 11th game of the second set to serve for the match.
But the big-serving 26-year-old was broken back, firing a forehand wide to give del Potro a break point which the 2009 US Open winner converted with a backhand winner.
Raonic was close again with a 5-4 lead in the tiebreaker and two service points to come. But he double-faulted and sent a forehand wide to give del Potro a set point that the seventh seed couldn't convert.
Copyright Agence France-Presse, 2017