Sanchez was perfect until the fifth inning, when Juan Uribe reached on an error and Pablo Sandoval singled to center field for the team's only hit.
Sanchez (8-6) walked only one batter while tying his career high with eight strikeouts in his second career shutout, the other being a no-hitter against the D-backs in 2006.
"We had three baserunners, so there's not much to say about that game; we just got shut down," Giants manager Bruce Bochy said. "Their guy pitched well today. ... We just couldn't come up with anything offensively. Our biggest rally was an error and a bloop. He kept us off balance."
Posey struck out in the second and fifth innings, and in the seventh, he grounded into a 6-4-3 double play after Aubrey Huff led off the inning with a walk.
"Indifferent, I guess," Posey said in reaction to the streak ending. "I had fun with it. I concentrated on winning ballgames as much as possible, but I guess, in a way, it's kind of nice that the attention will go back to that instead of the streak."
Posey's streak ended with him on the cusp of joining Giants history, as he was one game away from tying Willie McCovey for the longest hitting streak by a rookie in the San Francisco era. Although the chance to have his name next to a Hall of Famer in the record book was a neat thought, Posey said he didn't see it as that big of a deal.
"It would have been something cool to have, but at the same time, I know who Willie McCovey is and I didn't know he had the Giants' rookie record for a hitting streak," Posey said.
Instead, the rookie catcher's streak will end as the second-longest rookie hitting streak in San Francisco history, and it ties him with the Royals' Jose Guillen for the second-longest streak in the Majors this season.
Only Josh Hamilton's 23-game hitting streak has been longer this year.
When asked if he learned anything during the streak, Posey said he gained even greater appreciation of Joe DiMaggio's record of 56.
"If somebody breaks the hit-streak record in my lifetime, I'd be shocked," Posey said. "Because pitching's so good, defense is so good -- guys are fast -- I think it's going to have to be a guy that's extremely fast, has some luck. There's a lot of attention on it, so you've got to try to keep your mind right as much as you can."
Giants starter Madison Bumgarner (4-3) pitched well enough to post his fifth quality start of the season, but he took the loss. After Dan Uggla starred in the batter's box during the first three games of the series, Florida's Mike Stanton was Thursday's big run producer, hitting RBI doubles in the second and fourth innings and scoring in the fifth on Ronny Paulino's sacrifice fly.
"There are a couple of pitches I'd like to have back, but you're going to miss some spots during the game, and there's not much you can do about," said Bumgarner, who allowed three runs on six hits in six innings. "I felt pretty good, and I feel it was a pretty decent start. Three runs -- a lot of games, we scored a lot more than that. We just happened to face a pitcher who was really on."
The loss split the four-game series at two games apiece for the Giants and Marlins, marking the first time since the beginning of the month against the Rockies that the Giants didn't win a series.
On Friday, the Giants and Dodgers will begin a three-game series at AT&T Park, giving Posey a chance to start another hitting streak. That wouldn't surprise Bumgarner.
"I don't know if he was putting any of the pressure on himself about it, but I think it's definitely not going to hurt him," Bumgarner said. "He could come back tomorrow and get three or four hits. He's that great of a player."
In that event, fans and the media can watch Posey intently all over again.