MIAMI -- Sunday's game between the Miami Marlins and the Los Angeles Dodgers featured two of the game's best right fielders -- Giancarlo Stanton and Yasiel Puig, respectively -- and both were involved in much of the most crucial action.

In the end, Miami's Stanton emerged with two home runs, the major league lead in RBIs and the victory, while Los Angeles' Puig was sprawled on the ground, injuring his head and lower left leg on the game's final play.

And the ultimate hero was a lesser-known player, infielder Jeff Baker, who hit a two-out, 10th-inning, walk-off double off the fence in right field to lead Miami past the Dodgers 5-4 at Marlins Park.

"It kind of took off," Marlins left fielder Christian Yelich said of Baker's shot, which eluded Puig. "It kept going back, going back, and everybody in our dugout was yelling and hoping it would go over (Puig's) head, and it did."

Yelich said he was thrilled for Baker, who had snapped a career-worst 0-for-25 slump on Tuesday.

"He's been hitting some balls hard that have been caught," Yelich said. "For him to come up big in that situation feels great for us and for him."

Marlins shortstop Adeiny Hechavarria scored the winning run from third base when Baker, a late-game substitution, hit his opposite-field double off the fence. Puig nearly got a glove on it and crashed into the fence during his attempt.

"I'm going to check on him," Marlins pitcher and fellow Cuba native Jose Fernandez said of Puig, who stayed on the ground for several minutes before being helped off the field. "We're friends, and I don't want anything to happen to him."

Puig passed a concussion test after the game and the team said his status is day to day.

"He hit the wall hard and was pointing at multiple areas of his body where he was hit," Dodgers manager Don Mattingly said. "He seemed to be OK when he was walking in.

"He almost made an unbelievable play, though."

Stanton, who started the day tied for the major-league lead with 33 RBIs, drove in three runs Sunday. His solo homer to left in the sixth inning snapped a 3-3 tie and marked his 10th homer of the season, which, temporarily at least, put him atop the National League in that category.

Fernandez, who is 12-0 at home in 20 starts dating to 2013, got a no-decision.

Fernandez struck out 10 in seven innings, allowing three runs, two of them earned. He threw a career-high 114 pitches, and he reached double figures in strikeouts for the third time in his seven starts this season. Last season, he had four double-figure strikeout games.

Marlins' right-handed reliever A.J. Ramos blew a save chance in the ninth. Miami led 4-3 until Dodgers outfielder Andre Ethier, a late-game substitution, hit a run-scoring double to right. Stanton tried to come in to make a diving catch, but the ball got past him, allowing pinch hitter Chone Figgins to score from first.

Miami loaded the bases with two outs in the seventh, but left-hander J.P. Howell struck out third baseman Casey McGehee looking at a 3-2 pitch that was a borderline strike.

The Marlins (16-15) won for the fifth time in six games. They also earned their second walk-off win of the season.

The Dodgers (18-14) dropped the decisive game in the three-game series.

Miami opened the scoring in the first inning on Stanton's two-run homer to right.

The Dodgers tied the score in the third on a rally that started with second baseman Dee Gordon's two-out single.

Gordon advanced to third on Puig's single and scored on ex-Marlins shortstop Hanley Ramirez's single to right-center. Marlins center fielder Marcell Ozuna slid to try to make the catch but did not fully extend his glove.

Puig then scored on a passed ball by catcher Jarrod Saltalamachhia, who failed to handle a low-and-outside pitch than glanced off his mitt for an unearned run.

In the fifth, Fernandez was hit in the left leg by a sharp one-hopper by Gordon.

"It hit me hard -- I wasn't expecting that," Fernandez said. "My hamstring got tight right away. It was a little tougher to pitch after that but probably I will be fine."

Gordon, who leads the majors with 19 steals, then took off for second but was thrown out by Saltalamacchia. It was just the third time Gordon has been thrown out this season -- twice by Saltalamacchia in this series.