Boston (3-4-0) has lost three in a row, getting outscored 14-4 in those games, including 9-0 in the second period.
The Bruins cited discipline as their problem Wednesday. Nash and Pirri converted on two of New York's four power plays in the second period and the Rangers were 2-for-6 in the game. Boston was 0-for-1 on the power play.
"We played well right from the get-go and I think the first half of the game was pretty good," Bruins coach Claude Julien said, "but you can't win hockey games with the number of penalties that we were given."
Bruins rookie goalie Zane McIntyre made 26 saves in his first NHL start. He made nine saves in a strong first period, when he was backed by goals from forwards David Pastrnak at 10 seconds and Austin Czarnik at 14:44. It was Czarnik's first NHL goal.
The game started unraveling for McIntyre and his teammates midway through the second.
Nash scored a power-play goal at 9:06. Hayes followed with his game-tying goal at 16:35. Pirri scored the go-ahead goal on the power play at 19:24.
Pirri scored again at 2:23 of the third and Vesey, a Boston native who played at Harvard University, scored at 3:06.
"Highs and lows," McIntyre said. "I think it's about maybe conquering those highs and lows, not getting too upbeat after a good save or a nice play and not getting too low after you get scored on. The biggest thing was just getting in there, seeing the action, really taking it all in and making sure that I can improve. ... It's just obviously not the result we were looking for."