Wanyama's strike, in the eighth minute of stoppage time, was the third consecutive penalty kick for Montreal, after video review confirmed Red Bulls goalkeeper Carlos Coronel left the goal line early when saving the previous two attempts on Bjorn Johnsen and Mason Toye.
The win snapped Montreal's (7-7-5, 26 points) winless streak at five games.
New York (5-9-4, 19 points) is now winless in its past seven matches (0-4-3).
Neither side was able to generate much through the first five minutes.
The Red Bulls had the first opportunity to score in the sixth minute off a corner but a diving Sebastian Breza got his hands on the ball to deflect it away.
It wasn't until the ninth minute that the home side had its first chance to break the scoreless draw off a shot from Joaquin Torres from the top of the box that was saved by Coronel.
Montreal found its legs thereafter, venturing into the attacking third with regularity but couldn't beat Coronel. In the 11th minute, he snared a far shot from Toye. Six minutes later, Coronel robbed Montreal of what looked like a sure goal when he was able to get in the way of a quick strike from Zachary Brault-Guillard right at the goalmouth off a cross from Toye.
Toye came within inches of tying the match in the 69th minute on a perfect cross feed from Torres but his shot sailed just wide of the top right corner.