Machado stepped up to the plate with the bases loaded and the game tied in the top of the third inning before his go-ahead round-tripper sparked the win Tuesday in Los Angeles.
The Dodgers took an early lead on a Chris Taylor RBI single in the bottom of the second inning. Austin Hedges then tied the score with an RBI single for the Padres in the top of the next inning.
Padres outfielder Jurickson Profar reached base on a throwing error in the next at-bat. Dodgers starter Ross Stripling then allowed a single to Fernando Tatis Jr., which loaded the bases for San Diego. Stripling forced a ground out before Machado stepped into the box.
The slugger's brief exchange with Stripling featured just one pitch.
Stripling slipped an 80.9-mph slider to Machado. The Padres star swung and smashed the offering to center field for a 410-foot grand slam. The laser-style longball traveled 105 mph before it left the field in 5.4 seconds, according to Statcast.
Profar hit his second home run of the season in the fifth frame to increase the Padres' lead to 6-1. Austin Barnes plated the Dodgers' final score with an RBI single in the bottom of the ninth.
Stripling allowed six hits and six runs in 4.2 innings to take his first loss of 2020. Padres starter Garrett Richards allowed six hits and one run in six innings to earn his first win of the season.
Machado went 2 for 4 with four RBIs and a run scored in the win. Profar, Tatis and second baseman Jake Cronenworth had two hits apiece for the Padres. Taylor and Barnes each went 2 for 4 for the Dodgers.
The Dodgers (11-7) host the Padres (11-7) at 9:40 p.m. EDT Wednesday at Dodger Stadium.