The film also stars Kalki Koechlin, Gulshan Devaiah and Monica Dongra.
Confirming the news Ali said, "Yes I have been approached for the part in what I call the wee hours of the movie's commencement, to replace Arjun Rampal due to some issues."
"I read the part and said yes immediately, it is a challenging role, so I have already immersed in the looks and costumes of the film because there is very little time to prepare," the 28-year-old actor said in a statement.
Earlier, Karishma Kotak was set to play the female lead but the film eventually landed in Kalki's lap.
Love Affair is about infidelity in marriage. Ali will be playing Kalki's husband and Gulshan will be seen in the role of her lover.
The film is reportedly loosely based on a real life passion crime case.