TORONTO — Shane McClanahan struck out seven and extended his career-best scoreless streak to 21 2/3 innings as the Tampa Bay Rays survived a five-run Blue Jays rally and won in extra innings, improving to 16-2 over their last 18 games and 28-13 overall.

McClanahan held Toronto hitless until the fifth inning, walked just one batter and finished after five innings and 80 pitches as the Rays continue managing his workload following injuries that sidelined him for 2 1/2 seasons. His ERA dropped to 2.27, fifth-best in the American League among pitchers with at least 35 innings. Fellow Rays starter Nick Martinez is fourth at 1.70.

“He had everything going again,” manager Kevin Cash said. “He was nasty.”

McClanahan’s changeup was virtually unhittable, as Toronto’s right-handed hitters whiffed on half of their 14 swings against the pitch. He finished at least one strikeout with each of his four pitches, including four with the changeup. Through 39 2/3 innings this season, he has racked up 41 strikeouts while allowing only 24 hits. After issuing 11 walks in his first three starts, he has permitted only four over his last five outings.

The left-hander’s biggest moment came in the fifth, when Junior Caminero’s error and singles by Ernie Clement and Daulton Varsho put two runners in scoring position. McClanahan won a seven-pitch battle with Davis Schneider, who went down looking at a high slider, then blew a 97.2 mph fastball past catcher Brandon Valenzuela to end the threat.

“It’s called competing my butt off, and that’s just what it is,” McClanahan said. “When big moments get big, just got to compete. And that’s kind of been the difference. I feel like, with myself over the last maybe month or so.”

The Rays led by five runs with nine outs to go before the Blue Jays erupted for a five-run seventh inning against relievers Casey Legumina, Cole Sulser and Kevin Kelly, aided by multiple misplays from Caminero. But Tampa Bay answered in the 10th when shortstop Taylor Walls singled through a drawn-in Toronto infield to score Cedric Mullins. After Yandy Díaz walked, Walls advanced on a wild pitch and scored on Jonathan Aranda’s sacrifice fly, which center fielder Varsho caught while slamming into the wall. Garrett Cleavinger allowed the automatic runner to score in the bottom of the 10th but recorded the final three outs.

“That’s what we do. We’ve got to scrap wins out,” Walls said. “When guys fall, help them up. Do what you can to have their back. And if you do that over the course of 162, you’re gonna find yourself in a good spot.”

Aranda, speaking through interpreter Kevin Vera, praised McClanahan’s return to form. “He’s been spectacular,” Aranda said. “Obviously, we missed him when he wasn’t on the mound. … It’s great that we’ve seen him get back to his usual self, but obviously he’s been helping out our team and winning ballgames. And he’s been just great to watch.”

McClanahan joined teammate and close friend Drew Rasmussen as the only pitchers in franchise history with four straight scoreless starts of at least five innings. The Rays continue their series in Toronto before returning to Florida.