The deal was announced Saturday.
Gilroy had three goals and 11 points in 58 games with the New York Rangers last season. He played college hockey at Boston University, where he won the Hobey Baker Award in 2009.
Gilroy signed with the Rangers as an undrafted free agent in April 2009. In two seasons with New York, the Long Island native has seven goals and 19 assists in 127 games.