Carr, 30, has put pen to paper on a deal for the 2021/22 season with the club.
The experienced centre-back has featured at Basford since October 2016, joining from Grantham, having also had spells with Quorn & Stamford and having played professionally for Cambridge United.
Head coach Tom Shaw said: "I am so pleased to be able to bring Lewis to the club. He is a really impressive man with how he carries himself on and off the pitch and fits the profile perfectly for the role within the group that he will play.
"He has played a lot of games at this level at the top end of the division and brings a wealth of experience. He is mobile and athletic and that will allow us to defend how we want to defend with his physicality. He will partner a younger centre half next season so his character, personality and nous will hugely benefit those around him.
"I feel this signing shows the pull of Gainsborough Trinity as a football club, its fan base and reputation along with the way we will be working this season have attracted Lewis ahead of potentially better offers financially elsewhere."
Keep up-to-date with our exclusive email newsletters.
Subscribe