Starlin Castro also had an impact for the Marlins, going 4-for-5 with a double and an RBI.
The Dodgers, who won 104 regular-season games last season and made it to the World Series, took their sixth consecutive loss.
Yasmani Grandal led the Dodgers, going 2-for-4 with a homer, two RBIs and two runs.
Neither rookie starting pitcher earned a decision.
Miami's Elieser Hernandez, a 23-year-old native of Venezuela, made his first major league start and left with a 5-1 lead. He pitched five innings and allowed one run on three hits and one walk.
Hernandez struck out two in just his third major league appearance, lowering his ERA for the year to 2.25. However, he was denied a victory when Miami's bullpen couldn't hold the lead.
The Dodgers' Walker Buehler allowed seven hits, two walks and five runs, four earned, in five innings. He struck out seven.
Miami opened the scoring in the first inning. Martin Prado led off with a single, advanced to second on Bour's two-out walk and scored on Brian Anderson's single to center.
The Marlins extended their lead to 2-0 with an unearned run in the third. Prado reached on an error by shortstop Chris Taylor, advanced to second on a groundout and scored on Castro's ground-ball single to center.
Grandal's fourth-inning homer -- which traveled 408 feet to center -- cut Los Angeles' deficit to 2-1. It was Grandal's seventh homer of the season, and it came on a 3-2 fastball.
Bour slugged his opposite-field homer in the fifth, helping Miami take a 5-1 lead. He hit a 96 mph fastball on a 3-2 pitch by Buehler for his ninth homer of the season. Miguel Rojas capped Miami's three-run rally with a sacrifice fly, scoring Anderson, who had singled.
The Dodgers scored four runs in the sixth. Miami reliever Junichi Tazawa allowed a double to Joc Pederson, an RBI single by Grandal and another two-bagger, to Cody Bellinger.
Reliever Drew Steckenrider (2-1) allowed Taylor's RBI single and Mike Muncy's two-run, ground-rule double that tied the score 5-5.
Realmuto answered that rally with his two-out homer in the bottom of the sixth. It was Realmuto's sixth homer of the season, and he did it by belting a changeup from reliever Pedro Baez (1-2).
Brad Ziegler pitched a scoreless ninth inning to earn his seventh save of the season.
--Field Level Media