EX-5.1 2 a2239239zex-5_1.htm EX-5.1
QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

LOGO

www.velaw.com
Tel 713.758.2222 Fax 713.758.2346

July 10, 2019

Magnolia Oil & Gas Corporation
Nine Greenway Plaza, Suite 1300
Houston, Texas 77046

Re:    Registration Statement on Form S-3

Ladies and Gentlemen:

        We have acted as counsel to Magnolia Oil & Gas Corporation (f/k/a TPG Pace Energy Holdings Corp.), a Delaware corporation (the "Company"), with respect to certain legal matters in connection with the preparation and filing of a registration statement on Form S-3 (as it may be amended from time to time, the "Registration Statement") with the Securities and Exchange Commission under the Securities Act of 1933 (the "Securities Act") relating to the offer and sale, from time to time, by the selling stockholders identified in the Registration Statement of an aggregate of (a) 9,706,903 shares of Class A common stock, par value $0.0001 per share, of the Company (the "Class A Common Stock") including (1) 6,812,352 shares (the "New Class A Common Stock") of Class A Common Stock currently owned by the selling stockholders and (2) 2,894,551 shares of Class A Common Stock (the "Class B Conversion Shares") that may be issued upon exchange of Magnolia LLC Units (as defined in the Registration Statement) with an equal number of shares of the Company's Class B common stock, par value $0.0001 per share.

        In connection with this opinion, we have examined the following documents: (i) the Registration Statement, (ii) the Second Amended and Restated Certificate of Incorporation of the Company (the "Certificate"), (iii) the Bylaws of the Company, (iv) the Amended and Restated Limited Liability Company Agreement (the "Magnolia LLC Agreement") of Magnolia Oil & Gas Parent LLC ("Magnolia LLC"), (v) the Registration Rights Agreement, dated as of July 31, 2018, by and among the Company and certain of the selling stockholders, (vi) that certain Purchase and Sale Agreement, dated May 6, 2019, by and among Magnolia Oil & Gas Operating LLC, the Company and the other parties named therein, (vii) the records of corporate proceedings that have occurred prior to the date hereof with respect to the Registration Statement, and (viii) such other certificates, statutes and other instruments and documents that we considered necessary or appropriate for the purpose of rendering the opinions set forth below. In addition, we have reviewed such questions of law as we considered necessary or appropriate. As to matters of fact relevant to the opinions expressed below, and as to factual matters arising in connection with our review of corporate documents, records and other documents and writings, we have relied upon certificates and other communications of corporate officers of the Company, without further investigation as to the facts set forth therein.

        For purposes of rendering the opinions set forth below, we have made the following assumptions: (i) the Registration Statement, and any amendments thereto (including post-effective amendments), will have become effective and such effectiveness shall not have been terminated or rescinded, (ii) each document submitted to us for review is accurate and complete, each such document that is an original is authentic, each such document that is a copy conforms to an authentic original, and all signatures on each such document are genuine, (iii) each person signing the documents that we reviewed has the legal capacity and authority to do so, (iv) each certificate from governmental officials reviewed by us is accurate, complete and authentic, and all official public records are accurate and complete, (v) all

   

LOGO


LOGO

shares of Class A Common Stock will be issued and sold, as applicable, in compliance with applicable federal and state securities laws and in the manner stated in the Registration Statement and the applicable prospectus supplement, if any and (vi) at the time of issuance of any Class B Conversion Shares, (a) the Company will validly exist and be duly qualified and in good standing under the laws of its jurisdiction of formation, (b) the Company will have the necessary organizational power and authority to issue the Class B Conversion Shares, as applicable, and (c) the Company will have made available for issuance such number of Class B Conversion Shares.

        Based upon the foregoing and subject to the limitations, qualifications and assumptions set forth herein, we are of the opinion that:

    1.
    The New Class A Common Stock are validly issued, fully paid and non-assessable.

    2.
    The Class B Conversion Shares, when issued and delivered in accordance with the terms of the Magnolia LLC Agreement and the Certificate, will be validly issued, fully paid and non-assessable.

        Our opinions expressed herein are limited in all respects to the General Corporation Law of the State of Delaware, which includes all applicable provisions of the Delaware Constitution and the reported judicial decisions interpreting such laws, and the federal laws of the United States of America. We do not express any opinion as to the applicability of, or the effect thereon, of the laws of any other jurisdiction, domestic or foreign. We express no opinion as to any matter other than as set forth herein, and no opinion may be inferred or implied herefrom. Our opinion is given as of the date hereof, and we undertake no, and hereby disclaim any, obligation to advise you of any change in any matter set forth herein.

        We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to Vinson & Elkins L.L.P. in the prospectus forming a part of the Registration Statement under the caption "Legal Matters." In giving this consent, we do not admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act.

    Very truly yours,

 

 

/s/ Vinson & Elkins L.L.P.



QuickLinks