EXHIBIT 5.1 ----------- [LETTERHEAD OF PRYOR CASHMAN SHERMAN & FLYNN LLP] December 22, 1999 NexMed, Inc. 350 Corporate Boulevard Robbinsville, New Jersey 08691 Ladies and Gentlemen: We are acting as counsel to NexMed, Inc., a Nevada corporation (the "Company"), in connection with the Registration Statement on Form S-8, File No. 333-______ (the "Registration Statement"), as filed by the Company with the Securities and Exchange Commission with respect to the registration under the Securities Act of 1933, as amended (the "Act"), of 4,580,000 shares (the "Shares") of common stock, par value $0.001 per share, for delivery under the Company's Non-Qualified Performance Incentive Program, Non-Qualified Stock Option Plan, Stock Option and Long Term Incentive Compensation Plan and Recognition and Retention Stock Incentive Plan (collectively, the "Plans"). We are qualified to practice law in the State of New York. We express no opinion as to, and, for the purposes of the opinion set forth herein, we have conducted no investigation of, and do not purport to be experts on, any laws other than the laws of the State of New York, the Nevada General Corporation Law and the federal securities laws of the United States of America. We have examined such documents as we considered necessary for the purposes of this opinion. Based on such examination, it is our opinion that the Shares have been duly authorized and, upon issuance in accordance with the Plans, will be legally issued, fully-paid and non-assessable under the laws of the State of Nevada. We consent to the use of this opinion as an exhibit to the Registration Statement. This opinion is furnished in connection with the transactions covered hereby. This opinion may not be relied upon by you for any other purpose, or furnished to, quoted to, or relied upon by any other person, firm or corporation for any purpose, without prior written consent. Very truly yours, /s/ Pryor Cashman Sherman & Flynn LLP