The 30-year-old, who previously had a loan spell at Sincil Bank during the 2008-09 season, joins the Imps on a one-year deal with an option to extend beyond the summer of 2019.
O'Connor made 42 appearances for the Magpies following his switch from Port Vale in 2016 but was sidelined for the majority of the 2017-18 campaign with a knee injury.
Although O'Connor was offered a new contract by the League Two Magpies, the midfielder rejected the deal in favour of a switch to County's East Midlands rivals.
"It's a very important signing because, positionally, he's so intelligent and disciplined," Lincoln manager Danny Cowley told Lincolnshire Live. "He's physically strong, breaks the play up well and uses the ball well.
"He'll give a platform to our other midfield players to be able to join in [with the attack] and do what they do best. He'll give licence to Tom Pett, Lee Frecklington and also to young Ellis Chapman."
O'Connor, who has been capped by his country 11 times, also previous played for Crewe Alexandra, Scunthorpe United, Rotherham United and Port Vale.