Carrey plays Steven Russell, a married conman who falls in love with cellmate Phillip Morris (McGregor) in prison. He ends up being sentenced to a total of 144 years in jail after he tries to escape four times.
Mann will play Carrey's wife in the black comedy, directed by Bad Santa writers Glenn Ficarra and John Requa.
Luc Besson, Mad Chance's Andrew Lazar and Far Shariat are producing, according to The Hollywood Reporter.
Mann will next be seen alongside Adam Sandler and Seth Rogen in husband Judd Apatow's new comedy.