New York City (6-5-2, 20 points) ended a two-game losing streak that included a 2-1 defeat to Montreal on July 7.
CF Montreal (6-4-4, 22 points) had its three-game winning streak snapped and lost for the first time in seven matches.
Valentin Castellanos had a couple of chances to get the home side on top first. In the 16th minute, his shot from the top of the box forced goalkeeper James Pantemis into a diving save, getting his hand on it to deflect it out of harm's way. In the 27th minute, Castellanos was right in front ready to redirect a pass, but it was Pantemis who got to the ball first.
New York finally broke through near the half-hour mark. Barraza sent a long ball up the field, and Tajouri-Shradi hustled to beat Montreal defender Zohran Bassong at the top of the box, lifting the ball over Pantemis to give New York a 1-0 lead.
New York kept the pace up early in the second half but couldn't connect. Jesus Medina was right in front to direct the rebound of a header after a Pantemis save, but Montreal's defense was on it first to deny the midfielder.
The visitors thought they had the equalizer in the 49th minute when Johnsen found the back of the net, but the play was ruled offside.
Tajouri-Shradi came within inches of scoring his second of the match in the 56th minute, but his shot from the top of the box hit the crossbar.
Medina nearly made it 2-0 in third minute of second-half stoppage time with a shot from the top left corner of the box, but the ball sailed just wide right of the net.