The Marlins right-hander labored with his control early on, and he was trailing by two runs to Arizona while throwing 57 pitches through two innings.
But after back-to-back walks to open the second, Sanchez made a remarkable turnaround. He retired 18 straight, and he finished with 14 strikeouts.
Sanchez became just the third Marlins pitcher to reach as many as 14 strikeouts. A.J. Burnett did it twice, and the club record is 16 by Ricky Nolasco.
After the first two innings, Sanchez realized something needed to change.
"I said, I had to do something," he said. "I don't want to leave the game early. I tried to do a few pitches per hitters."
Sanchez's previous career high for strikeouts was 11, done twice last year. He reached the total against Washington on May 8. And he had 11 in a one-hitter over the Pirates on Sept. 10.
"Anibal has been throwing the ball well all year," manager Ozzie Guillen said. "So have his teammates. All five guys we have starting, they have had some quality games. Unfortunately, the team hasn't helped them win games."
Sanchez didn't factor into the decision, but he kept his club in the game for the late-inning rally.
"It was a day where everything didn't start very well, but it ended very well," Sanchez said.
Sanchez is no stranger to success against Arizona. As a rookie in 2006, the right-hander no-hit the D-backs at Sun Life Stadium.