In this work, we combined the non-solvent induced phase separation (NIPS) and further cross-linking by cations towards the preparation of nanofiltration membranes based on sodium alginate, a biodegradable, natural polymer. Acetone, ethanol, toluene, and hexane were used as non-solvents, and cations of calcium, silver, and aluminum—for polymer cross-linking, respectively. Results showed the precipitation strength of non-solvent played a noticeable role in the membrane’s performance; for instance, the toluene permeability changed by four orders of magnitude with the decrease of precipitation strength of the non-solvent: acetone (Ptoluene = 0.1 kg∙m−2∙h−1∙bar−1) < ethanol (3 kg∙m−2∙h−1∙bar−1) < hexane (41 kg∙m−2∙h−1∙bar−1) < toluene (415 kg∙m−2∙h−1∙bar−1). It was shown that simultaneous precipitation and crosslinking in aqueous solutions AlCl3 or AgNO3 must be used in the preparation of alginate membranes for the highly selective recovery of pharmaceutical compounds from organic media. These membranes show rejection R = 90–93% of substances with MW = 626 g/mol and ethanol permeability PEtOH = 1.5–2.5 kg∙m−2∙h−1∙bar−1. For the highly selective recovery of pharmaceutical compounds from water, the method of obtaining membranes must be changed. Precipitation in toluene and then crosslinking in aqueous solutions of AlCl3 or AgNO3 must be used sequentially instead of simultaneous precipitation and crosslinking in aqueous solutions of the same inorganic salts. The permeability of such membranes varied from 0.44 to 7.8 kg∙m−2∙h−1∙bar−1 depending on the crosslinking cation in the alginate. The rejection of model substances with MW 350 and 626 g/mol were on the level of 99%. Alginate membranes can be used to solve separation problems in the pharmaceutical field, for example, to isolate antibiotics from their extractants and remove the same antibiotics from aqueous pharmaceutical waste to prevent their accumulation in the environment and the emergence of resistant genes and bacteria.