Johnson, who did not face a break point in the first set, saved one on his opening service game in the second set, where he also missed four chances to break Raonic's serve.
Raonic, from Thornhill, Ont., ended a three-match losing skid by breaking Johnson's serve for the first time in the 10th game. The Canadian will face American Donald Young in the next round.
Raonic defeated Young in their only previous meeting last summer in Washington.
Meanwhile, eighth-seeded Ivo Karlovic had 23 aces as he advanced with a 7-6 (4), 6-3 win against Lukas Rosol. Vancouver's Vasek Pospisil was scheduled to play his first-round match against Finland's Jarkko Nieminen later Tuesday.
Raonic has struggled of late after battling a virus that sapped his strength and limited his energy. But the Canadian came through in the first-set tiebreaker and finished with 12 aces.
"I managed to stick around in that first set," Raonic said. "I made the most of the opportunities I had in the breaker. I felt I was playing better and better, but I need to get significantly better for my next match. But I feel like I'm on the right track."
Karlovic won 95 per cent of his first-serve points and next plays Frenchman Kenny De Schepper, who beat Argentina's Federico Delbonis 7-6 (3), 7-5.
In other first-round action, German Benjamin Becker needed just over one hour to breeze past qualifier Gastao Elias of Portugal 6-3, 6-2. He next faces either third-seeded Stanislas Wawrinka of Switzerland or Kazakhstan's Mikhail Kukushkin, who played later Tuesday.
Croatia's Ivan Dodig needed nearly three hours to get the better of Swiss wild card Marco Chiudinelli 6-4, 6-7 (7), 6-4 and next plays seventh-seeded David Goffin of Belgium.
Top-seeded Roger Federer and No. 2 Rafael Nadal, who struggled with appendicitis earlier this month in Shanghai, are in second-round action on Wednesday.
Federer, a recent winner in Shanghai, faces Luxembourg's Gilles Muller and Nadal takes on unheralded Frenchman Pierre-Hugues Herbert, a qualifier ranked 120th.
Raonic is working to recover his position in the race to reach the eight-man year-end final next month in London. After losing matches in Tokyo, Shanghai and Moscow, the ninth-ranked Canadian fell to 10th in the points race after being passed by Andy Murray and David Ferrer.
While he would love to do well in his first appearance in Basel, Raonic said next week's Paris Masters — with 1,000 points on offer — will be a key event.
With files from The Canadian Press.