The Canadiens also re-signed defenseman Mike Weaver, who played a key role in the club's surge to last season's Eastern Conference finals, to a one-year deal.
Montreal made room for both players with Tuesday's trade of Josh Gorges to the Buffalo Sabres for a 2016 second-round pick, a deal which also cleared future cap space for the Habs.
Gorges has four years remaining on his current contract with an average yearly cap hit of 3.9 million. Gilbert is slated to earn $5.6 million over his deal, with Weaver re-signing for $1.75 million.
Gilbert, 31, posted three goals and 25 assists over 73 games with the Florida Panthers in 2013-14. The Minnesota native has compiled 204 points (39 goals, 165 assists) over eight NHL seasons with Edmonton, Minnesota and Florida.
Weaver had a plus-17 rating over a combined 34 games between the regular season and playoffs after coming over to Montreal in a trade with Florida last March. The 36-year-old penalty-killing specialist has participated in 602 regular-season contests over a 12-year NHL career.