He will have an MRI on Thursday, the team said.
"I don't think this is a major strain," Scherzer said. "I was kind of tight and then all of a sudden it went. But I don't feel like I really ripped it. It just kind of got worse. So hopefully I got out of there quick enough to prevent a major injury here because I know oblique, intercostal, those things can be nasty. Hopefully I avoided a serious injury."
The three-time Cy Young Award winner left with two outs in the sixth inning and a 1-1 count on Albert Pujols. With two runners on, Scherzer threw a slider in the dirt and immediately signaled to the New York bench that he was done.
"Just felt a zing on my left side and just knew I was done," he said. "When I felt it, I just knew there's no way you can throw another pitch, so just get out of there."
Mets pitching coach Jeremy Hefner, manager Buck Showalter and a trainer came out of the dugout to visit Scherzer on the mound. After a quick discussion, the 37-year-old right-hander walked off the field.
"I don't rush out there, because usually it's not really good news," Showalter said. "He's been a great self-evaluator. He knows when he's at a point where if he pushes more, it's going to turn into something serious.
"He's not going to put himself in harm's way. A lot of guys might have tried to continue to pitch. I'm hoping we caught whatever's in there at an earlier stage of it."
Scherzer (5-1) threw 61 of his 87 pitches for strikes and left with a 6-2 lead against his hometown team. Adam Ottavino was given all the time he needed to warm up, and he struck out Pujols to end the inning.
The Mets went on to win 11-4.
"It's in spasm right now. It doesn't feel real good," Scherzer said after the game, chuckling. "But once you get the spasm subside, what's the actual extent of this injury? We don't know. So we'll know tomorrow."
Scherzer was unable to make his last scheduled start for the Los Angeles Dodgers in last year's National League Championship Series against the Atlanta Braves because of a tired arm. His first start for the Mets was pushed back a day because of a hamstring issue that cropped up late in spring training; otherwise, Scherzer has been healthy since signing a three-year, $130 million contract with New York in the offseason.
Off to a terrific start this year, the Mets have been without injured ace Jacob deGrom (right scapula stress reaction) all season, and he isn't expected back until at least late June or July. His effective replacement, Tylor Megill, went on the 15-day injured list on Sunday with right bicep inflammation.
The Associated Press contributed to this report.