Can a deed in lieu of foreclosure be done if there are 2 names on the deed but 1 name on the mortgage?

Hello. Two friends own a home together. Only 1 person’s name is on the mortgage but they are both on the deed. The friend who has the mortgage moved out. The home is now in foreclosure. The mortgage company is offering the friend a deed in lieu of foreclosure way out. Can the friend do the deed in lieu if there is another name on the deed? If she takes the deed in lieu, will the other friend be evicted from the home even though his name is also on the deed? And if so how quickly can he be evicted? The state is New Jersey. Thanks Everyone!

I know people will suggest a short sale but the 1 owner does not want to agree to this.
The friend doesnt want the deed, he wants to know if the deed in lieu can be done without his agreement. But it sounds like it can’t. He also wants to know if he does agree to the deed in lieu, then how long after that will he have to move out of the house?