MIAMI–Newtons third law of motion states that for every action, there is an equal and opposite reaction.

But if Sir Isaac dreamed up a fourth, it might have stated that for every Giants run, the Marlins would react with a run of their own.

That law has applied for each of the first three games of San Franciscos series in Miami, as the Giants fell 5-4 on a walkoff sacrifice fly by rookie Brian Anderson Wednesday.

Theyve played better ball than us these past three games, right fielder Andrew McCutchen said. Theyve taken three away from us. It definitely doesnt feel good when youre going in knowing these are ballgames you should be winning.

The Giants lost three leads in Mondays defeat, one on Tuesday and three more on Wednesday, with the last one coming after Evan Longoria poked an RBI single to push the Giants ahead 4-3 in the top of the seventh.

Before Monday, the Marlins hadnt come back from three deficits in a game to win since July 19, 2010. Theyve achieved the feat against the Giants twice in three days.

Were having a hard time holding a lead and thats whats frustrating, manager Bruce Bochy said. They just nicked us for a run tonight a few times. It seems like the walks are hurting us.

All three of the advantages the Giants lost Wednesday came after a Marlins leadoff hitter reached base, which occurred twice due to leadoff walks.

Starter Andrew Suárez and set-up man Sam Dyson were both offenders in the walkoff defeat, as Suárezs leadoff walk in the fourth keyed a two-run rally while Dysons free pass in the eighth preceded a game-tying double.

I just didnt really have a feel for a lot of pitches later on in the game, Suárez said. I just think with all the humidity and sweating so much the ball was a little slick. I had to compete and try to keep throwing strikes.

The final lead the Giants surrendered stung the most, particularly after Longoria hit a 100-mile per hour fastball from Tayron Guerrero up the middle to score Buster Posey in the seventh. The third baseman delivered his team-leading 34th RBI of the season on an 0-2 count and on the seventh pitch of an at-bat that featured six pitches faster than 98 miles per hour.

After Suárez allowed two runs in the fourth to spoil a 2-0 edge supplied by McCutchens seventh home run of the season in the first inning, it was Mark Melancon who let the Marlins swim against the current and overcome a 3-2 deficit in the sixth.

With a one-run lead and 12 outs to go, Bochy expected Melancon, Dyson, Tony Watson, Will Smith and Hunter Strickland to lock down the Marlins in the final four innings. Instead, Miami chipped away with runs in the sixth and eighth before pushing the winning run across in the ninth.

What I felt good about coming into tonights game is we had our pen lined up, Bochy said. They had plenty of rest.

Justin Bours 0-2 single to score J.T. Realmuto tied the score and set up a finish that highlighted the troubles that have plagued the Giants all series against the last-place Marlins.

You cant take any team lightly, this is the big leagues, McCutchen said. Regardless of their record, how many fans are in the stands, youve got to be ready. Ready to go, ready to win. Because the team on that other side, theyre ready too.

Suárez made his 10th major league start Wednesday, but his outing against Miami wasnt the first time he pitched at Marlins Park. The left-hander actually faced the Marlins back in 2012 in a stadium-opening exhibition while starting for the University of Miami Hurricanes.

It was just like any other field, I was just trying to compete and get a feel for the mound at first, Suárez said. I didnt really think back to that time in college.

Six years after throwing three innings in the first-ever contest at the stadium, Suárez returned home and saved tickets for 12 family members eager to watch a hometown pro attempt to defeat the hometown foes.

After retiring the first eight hitters he faced, Suárez allowed a single up the middle to opposing lefty Caleb Smith. That base hit didnt hurt him, but a leadoff walk to Anderson did in the bottom of the fourth.

Anderson and catcher Realmuto scored on RBI singles from Cameron Maybin and Lewis Brinson to even the score at 2-2. The Giants inability to hold their early 2-0 lead marked the fifth time in three games their pitching staff had coughed up a lead to the Marlins, a disturbing trend for a club that has consistently struggled to win on the road this season.