The two grew up just 40 miles apart in Massachusetts.
"I just thought it'd be a nice gesture. I'm sure his family's here," Hayes said after the game. "I'm sure he's going to have a lot of memories from this night. ... We've been in the same building for almost 10 years now pretty much in Boston every summer. It's a fun little group we have back home. ... It was just a small little gesture to add to his memory bank."
Farrell was selected by the Montreal in the fourth round (No. 124) in the 2020 NHL Draft and played for Harvard University the past two seasons. He signed a three-year, entry-level contract with the Canadiens on Sunday.
"That was awesome. He's such a world class guy," Farrell said. "I skate with him, work out with him in the summer. He's been great in the summers, he's always there to help guys along even when I was younger, coming up in college and stuff."
NHL.com deputy managing editor Adam Kimelman contributed to this report.