"We've kept all these games in check," Marlins manager Don Mattingly said. "We've been able to score some runs late, and give ourselves chances. But it has been a weird little five games with them."
Rojas and Lewis Brinson, who both made misplays earlier in the game, were at the center of the celebration in the ninth inning. After J.T. Realmuto made it 4-3 with a run-scoring double, Brinson's RBI single tied it at 4, and Rojas put Miami ahead with his own RBI base hit.
"I feel like the last couple of series, we've been playing pretty good baseball," Rojas said. "So much better at-bats, up and down the lineup. I'm so proud of the guys that never stop battling."
Miami is 6-2 in its last eight games, with four wins (all comebacks) against San Francisco.
"I've been saying it all year, I want to start contributing," Brinson said. "The past couple of weeks, I've been contributing to us scoring runs. Obviously, the defense has been there. Now, on the offensive side, I'm starting to see some results from my hard work."
Brinson went 2-for-3 with a walk, and is batting .300 (15-for-50) in June, and .183 on the season.
Trailing 4-2 entering their last at-bat, Brian Anderson got things going with a leadoff walk, and he scored on Realmuto's RBI double. Justin Bour walked, and Jose Urena replaced him as a pinch-runner. Cameron Maybin grounded into a fielder's choice, putting runners on the corners, and Brinson's RBI single to right tied it at 4.
Rojas capped the rally with his decisive single to right. Rojas finished with three RBIs, including his two-run single off Andrew Suarez in the fifth inning.
Kyle Barraclough closed out the ninth for the save, his fifth of the season and fourth since taking over as closer. The right-hander has not allowed a run over his last 17 games (16 2/3 innings). Rookie reliever Tayron Guerrero picked up his first big league win.
Miami's ninth-inning comeback took rookie Caleb Smith off the hook for a loss. Smith faced the Giants for the second time in five games, and the left-hander allowed four runs in four innings. On Wednesday at Marlins Park, Smith gave up three earned runs in 6 1/3 innings in a no-decision in a game Miami won.
But on Monday, on a chilly 61-degree night in San Francisco, Smith lasted just four innings for the second time in his last four starts. June has been a bit of a down month for the 26-year-old, who has a 5.49 ERA in four starts.
One of the top rookie pitchers this year, Smith was on point in May, posting a 2.60 ERA in five starts.
Also of note, Smith was away from the team for several days for personal reasons. On Monday, he was reinstated from the MLB bereavement list. He was excused from the team following his last start to attend a funeral.
Mattingly noted that Smith didn't get much help. In the second inning, Brinson misplayed Buster Posey's fly ball, which got caught up in the wind, and dropped for a double. It opened the door for a three-run inning, capped by Pablo Sandoval's two-run homer.
"It's a little tough out there," Brinson said. "I thought I was under it, and it kept going. It's something I've got to learn from."
MOMENTS THAT MATTERED Chipping back: Trailing by four runs in the fifth inning, the Marlins made a dent with Rojas' two-run single. Maybin started the rally with a leadoff single, and he went to third on Brinson's double. Rojas delivered a single to left, but on the play, he attempted to stretch the hit into a double, and was thrown out by Mac Williamson.
"I feel like that was a point in the game we were starting to turn it around," Rojas said. "I was happy for the hit. I saw the left fielder bobble the ball, and I thought I had the opportunity to make it to second base, and put myself in scoring position. I was kind of frustrated because I knew I killed the momentum, kind of. I put us in good position with two runs, but I killed the momentum, too."
SOUND SMART Barraclough has not allowed a hit over his last 10 2/3 innings. Ryan Webb had a similar stretch for the Marlins for 10 1/3 innings from April 23-May 12, 2012. The club record is held by Armando Benitez, 14 1/3 innings, from May 4-June 4, 2004.
HE SAID IT "He just stared at me. I don't know [what irked Strickland]. I have no idea. You can ask him. I just looked at him walk off the mound, and that was it. I didn't say anything." -- Brinson, on Strickland looking at him as he was replaced in the ninth inning
UP NEXT Dan Straily on Tuesday at 10:15 p.m. ET faces the Giants for the second straight start. Straily gets the middle game at AT&T Park. On Thursday in Miami, the right-hander struck out seven, allowing three runs, in a no-decision. Dereck Rodriguez, the son of Hall of Famer Ivan "Pudge" Rodriguez, goes for the Giants.