You definitely need to seek the assistance of an experienced EB-5 attorney. You may borrow funds from a friend but you will have to show that you have the financial means to pay back the loan on a regular basis. Your friend who derived the $500,000.00 from a loan by the bank will have to show the lawful source of the funds to purchase the apartment.
You need to authenticate the source of funds no matter the source. A gift must be authenticated to show where the person giving the gift obtained the funds initially. If that source cannot be authenticated, then you may need to find another source.