It was the hosts who started on the front foot, but Thomas Mangani's effort from the right missed the target.
They managed to capitalise on their early domination in the 21st minute when Alo'o Efoulou put Nancy in front with a right-footed shot into the bottom left of the goal.
Their lead last just 13 minutes when Khalifa drew the away team level after latching on to a Milos Ninkovic through-ball.
Five minutes later, Nancy regained the lead through Moukandjo, who tapped in from close range following Mangani's assist.
The combination was repeated 10 minutes from time when Moukandjo added his second and Nancy's third after heading home Mangani's cross.