The 25-year-old made 36 appearances for the Shrimpers across two seasons, having joined after leaving Burnley.
O'Neill said he moved to Ady Pennock's side despite other offers.
"The major part of me signing was after speaking with (boss) Ady and (director of football) Peter Taylor who filled me with confidence, assuring me that I would be playing games," he said.
Find all the latest football transfers on our dedicated page.
Gillingham have signed defender Luke O'Neill on a two-year deal after his release by League One rivals Southend.