Miami, which was 0-6-1 in its previous seven matches, recorded its first win since May 16 and its first on its home pitch this season.
Montreal has now lost three straight after a six-game unbeaten run.
Joaquin Torres gave Montreal a 1-0 lead in the 20th minute. Miami goalkeeper Nick Marsman came out to play the ball, diving forward for the save as a charging Mason Toye tried to get his foot on it. Marsman was down on the pitch after contact with Toye's foot, and a trailing Torres connected with the loose ball outside the goalmouth and sent it into the open net.
Marsman stayed down for several minutes but remained in the game.
Montreal dominated possession and dictated play for most of the first half but the home side started to press for the equalizer in the later stages of the opening 45 minutes.
In the 35th minute, Robbie Robinson's header at the front of the net went wide left. In the 41st minute, Federico Higuain came close on a corner, forcing goalkeeper James Pantemis into a diving save, and in the first minute of stoppage time, Robinson was denied from the left side by a Montreal defender.
Gonzalo Higuain tied it for Inter Miami in the 49th minute on a penalty kick drawn by his brother, Federico. Gonzalo went low right on Pantemis, who guessed the ball would come from the other direction and dived left.
The Argentine striker put Miami ahead 2-1 in the 69th minute with his second of the match. Pantemis got a piece of the ball in the air off a shot from the top of the box but couldn't get all of it before it landed in the net.