While the consistent Ryu delivered another quality start, Puig went 0-for-5 and struck out twice. Hanley Ramirez also was hitless with two strikeouts as the offense was held to two runs again while going 0-for-8 with runners in scoring position.
But the division lead remains 7 1/2 games and panic isn't even a thought.
"It's like we talk about when we're winning every day -- one game doesn't lead to the next," said manager Don Mattingly. "The game's over, we play another tomorrow. Turn the corner, get ready to play. It's a simple formula. We didn't play bad. We just got beat."
Usually sparse attendance at Marlins Park in Little Havana swelled to 27,127 for the matchup between Cuban players Fernandez and Puig, who met for the first time on the field before the game.
"I'm pretty excited how it turned out -- a team win," said Fernandez. "If you're not on my team, I'm going to go out and get you. Even if it is my mom in there, I will try to get an out. That's what I'm here for.
"The result of the game, as a team, I think it's amazing. We just beat the best team in baseball. To me, that's the most important thing. As a person, [Puig] is a great guy. I was blessed to get to know him, and talk to him, as a friend, and not a player that I was going against. It was nice. He's pretty humble. A lot of people wouldn't think that, but he's amazing out there. He's a great talent. No doubt about it. We came out on top this time. But him, and that team, that lineup is one of the toughest I've faced this year. The Cardinals and them, pretty tough."
Fernandez lasted six innings before a 109 pitch count got him, charged with two runs (one earned) on four hits with eight strikeouts and three walks.
"He's a tremendous pitcher," said Puig. "He mixes his pitches well. My teammates and I came prepared, but obviously, we didn't do too well today against him."
Puig is seeing his offense head south lately.
His average, still a gaudy .351, was .435 when the club's torrid spell started June 22 and was still .401 as recently as July 9. After slugging four homers in his first six games, he had three in July and none since Aug. 1. He has four RBIs this month.
Ryu (12-4) made it through 7 1/3 innings, but it was his first loss since June 19. He allowed three runs on six hits, and the one he regretted the most was a two-out single by Fernandez on a fastball that led to a two-run third inning.
"That decided the game today," Ryu said. "I gave him a good fastball to hit. Looking back now, I wish I threw a curveball. The third inning was really crucial."
Christian Yelich followed by short-hopping the left-field wall to score Fernandez, and when Hanley Ramirez made the relay throw home, nobody was covering third base so Yelich advanced and beat a retreating Juan Uribe to the bag. Donovan Solano lined a single to right to score Yelich.
The Dodgers had the bases loaded with no outs in the fifth inning after an error by Miami third baseman Ed Lucas on a sure double-play bunt, but the Dodgers scored only once on a forceout by Carl Crawford as Fernandez struck out Puig and Adrian Gonzalez.
Puig was lucky he wasn't ejected. He gave home-plate umpire John Hirschbeck a dirty look after striking out and Hirschbeck snapped, finger-pointing at Puig, who threw a tantrum in the dugout and had to be hustled out of view by Uribe. The issue was a called strike two that Puig thought was outside.
"I thought it was a ball and he called a strike," said Puig. "He said it was there, and that is that."
Mattingly spoke to Hirschbeck the next inning, as he did after a less obvious scene in Philadelphia over the weekend. His words were cautious when asked if he felt umpires were testing the rookie.
"It's hard to say. They will only put up with so much," Mattingly said. "For me, he doesn't say anything [to Hirschbeck]. It's delicate. He's emotional. You're not going to take that out of him. For him, everything's emotional. He didn't say anything. He walked away."
The Dodgers tied the game in the sixth on Uribe's third hit of the night, an RBI double. Uribe is on a 17-for-32 tear.
"I got lucky," Uribe said of his success against Fernandez.
Miami took the lead for good in the sixth with another set of three consecutive hits off Ryu. Then the Marlins put the game out of reach by scoring three runs in the eighth off the Dodgers' bullpen, one on a massive homer by Giancarlo Stanton into the home run sculpture in center, and two more off J.P. Howell.