The signings of Lewis and Gwillim are the first by manager John Still since the Daggers claimed their historic League Two play-off victory at Wembley on Sunday.
Still had already brought in winger Danny Green and striker Alex Osborne before the end of the season.
Midfielder Lewis made 51 appearances for the Gills after signing from Stevenage Borough in 2008.
The former Spurs reserve player was part of the Kent club's League Two play-off winning side a season later.
Former Crystal Palace youth team player Gwillim played 121 games in the Blue Square Premier for Histon, after joining them from Bishop Stortford in 2007.
Despite still having a contract at the Glass World he was released by mutual consent.
Bookmark with:
What are these?