Please wait

QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

LOGO

March 2, 2018

Depomed, Inc.
7999 Gateway Blvd., Suite 300
Newark, CA 94560

Re:
Depomed, Inc.
Registration Statement on Form S-3

Ladies and Gentlemen:

        We have acted as counsel to Depomed, Inc., a California corporation (the "Company") in connection with the preparation and filing with the Securities and Exchange Commission (the "Commission") of a Registration Statement on Form S-3 (the "Registration Statement") under the Securities Act of 1933, as amended (the "Securities Act"), relating to the registration under the Securities Act and the proposed issuance and sale from time to time pursuant to Rule 415 under the Securities Act, together or separately and in one or more series (if applicable) of:

        The Debt Securities, Common Stock, Preferred Stock, Warrants, and Units are collectively referred to herein as the "Securities." The Senior Debt Securities are to be issued under an indenture entered into between the Company and The Bank of New York Mellon Trust Company, N.A. (the "Trust Company"), as indenture trustee (the "Senior Base Indenture"). The Subordinated Debt Securities are to be issued under an indenture substantially in the form attached to the Registration Statement (the "Form of Subordinated Indenture," and together with the Senior Base Indenture, the "Base Indentures").

        In arriving at the opinions expressed below, we have examined originals, or copies certified or otherwise identified to our satisfaction as being true and complete copies of the originals, of the Base Indentures, forms of the Debt Securities, specimen Common Stock certificates and such other documents, corporate records, certificates of officers of the Company and of public officials and other instruments as we have deemed necessary or advisable to enable us to render these opinions. In our examination, we have assumed the genuineness of all signatures, the legal capacity and competency of all natural persons, the authenticity of all documents submitted to us as originals and the conformity to original documents of all documents submitted to us as copies. As to any facts material to these opinions, we have relied to the extent we deemed appropriate and without independent investigation upon statements and representations of officers and other representatives of the Company and others.


        We have assumed without independent investigation that:

        Based on the foregoing and in reliance thereon, and subject to the assumptions, exceptions, qualifications and limitations set forth herein, we are of the opinion that:

2


3


        The opinions expressed above are subject to the following exceptions, qualifications, limitations and assumptions:

4


        You have informed us that you intend to issue Securities from time to time on a delayed or continuous basis, and we understand that prior to issuing any Securities pursuant to the Registration Statement (i) you will advise us in writing of the terms thereof, and (ii) you will afford us an opportunity to (x) review the operative documents pursuant to which such Securities are to be issued or sold (including the applicable offering documents), and (y) file such supplement or amendment to this opinion (if any) as we may reasonably consider necessary or appropriate.

        We consent to the filing of this opinion as an exhibit to the Registration Statement, and we further consent to the use of our name under the caption "Legal Matters" in the Registration Statement and the prospectus that forms a part thereof. In giving these consents, we do not thereby admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Commission promulgated thereunder.

Very truly yours,

/s/ Gibson, Dunn & Crutcher LLP

5




QuickLinks