Puig and Chase Utley, who went 2-for-2 with a walk, had two RBIs apiece for the Dodgers, who ended a four-game skid at home against the Marlins.
Los Angeles starter Hyun-Jin Ryu (2-5) allowed two runs on seven hits with three strikeouts and a walk in 5 1/3 innings. Relievers Chris Hatcher, Luis Avilan and Josh Fields combined for 2 1/3 hitless innings before Kenley Jansen struck out the final four batters for his eighth save.
Justin Bour and Christian Yelich homered for the Marlins (14-26), who have dropped 18 of their past 22 games.
Miami starter Edison Volquez (0-6) gave up five runs on eight hits with four strikeouts and three walks in six innings. Volquez is winless in 15 consecutive starts.
Dodgers third baseman Justin Turner left the contest at the end of the seventh after sustaining an apparent hamstring injury.
In the first inning, three consecutive singles by Utley, Corey Seager and Justin Turner loaded the bases for the Dodgers (24-18). Cody Bellinger followed by driving home Utley on a fielder's choice for a 1-0 lead.
Bour laced a 1-0 Ryu pitch into the seats in right for his ninth homer this season to tie the score in the second inning.
In the second, Puig put the Dodgers back in front 3-1 with a two-run homer off Volquez with one out. It was the eighth home run for Puig.
Utley's RBI single later in the second made it 4-1. Yelich smacked a solo shot, his sixth, in the third to slice the margin to two runs.
Gonzalez's run-scoring single in the third plated Turner, who reached on a walk and stole second, for a 5-2 advantage.
Utley hit an eighth-inning sacrifice fly, and Chris Taylor's bases-loaded walk later in the inning capped the scoring.
NOTES: The Dodgers activated 1B Adrian Gonzalez (elbow, back) from the 10-day disabled list and optioned 1B/OF Scott Van Slyke to Triple-A Oklahoma City. ... Marlins RHP Tom Koehler (right shoulder bursitis) and RHP Junichi Tazawa (rib cartilage inflammation) went on the 10-day disabled list. In corresponding moves, RHP Odrisamer Despaigne and RHP Brian Ellington were recalled from Triple-A New Orleans. The club also added INF Christian Colon to the 25-man roster and designated INF Mike Aviles for assignment. Miami INF Steve Lombardozzi, who was designated for assignment Tuesday, was outrighted to New Orleans. ... Marlins LHP Justin Nicolino (0-0, 1.50 ERA) will oppose Dodgers LHP Alex Wood (4-0, 2.27) on Friday.