It was an open secret that the 26-year-old had been frozen out at Dens Park after a bust-up with manager Neil McCann a couple of months ago.
The Easter Road club have snapped up Bain until the end of the season, when his contract at Dens Park runs out.
Bain said: “I am delighted to be joining up with Neil Lennon’s squad.
“From the outside looking in the side have had a fantastic first half of the season, and I hope to help them build on that in 2018.
“It’s a strong group of players and I am excited about meeting everyone in Portugal for the training camp. Hopefully I can hit the ground running and force my way into the manager’s thoughts.”