Texas Tower, 845 Texas Avenue, Suite 4700 Houston, TX 77002 Tel +1.713.758.2222 Fax +1.713.758.2346 velaw.com Vinson & Elkins LLP Attorneys at Law Austin Brussels Dallas Denver Dubai Dublin Houston London Los Angeles New York Richmond San Francisco Tokyo Washington August 6, 2026 Granite Ridge Resources, Inc. 5217 McKinney Avenue, Suite 400 Dallas, Texas 75205 Ladies and Gentlemen: We have acted as counsel for Granite Ridge Resources, Inc., a Texas corporation (the “Company”), as successor to Granite Ridge Resources, Inc., a Delaware corporation (the “Delaware Corporation”), in connection with the Post-Effective Amendments (collectively, the “Amendments”) to the following registration statements on Form S-8 previously filed with the Securities and Exchange Commission (the “SEC”) by the Delaware Corporation under the Securities Act of 1933, as amended (the “Act”) (collectively, the “Registration Statements”): (i) Registration No. 333-269036, to which Post-Effective Amendment No. 1 relates, and (ii) Registration No. 333-296354, as previously amended by Post-Effective Amendment No. 1 filed with the SEC on June 2, 2026, to which Post-Effective Amendment No. 2 relates. The Amendments are to be filed with the SEC on August 6, 2026. The Registration Statements relate to the registration under the Act of shares of the Company’s common stock, par value $0.0001 per share (the “Common Stock”), issuable in respect of awards under the Plan (as defined below). On August 5, 2026, the Company changed its state of incorporation from the State of Delaware to the State of Texas (the “Reincorporation”) pursuant to a plan of conversion (the “Plan of Conversion”). As part of the Reincorporation, all compensation or benefit plans of the Delaware Corporation in effect immediately prior to the Reincorporation continue to be compensation or benefit plans of the Company following the Reincorporation, including the Granite Ridge Resources, Inc. Amended and Restated 2022 Omnibus Incentive Plan (including any schedules or appendices thereto, as amended from time to time, the “Plan”). Additionally, each equity-based award relating to the common stock of the Delaware Corporation granted by the Delaware Corporation pursuant to the Plan (collectively, the “Delaware Corporation Awards”) that was outstanding immediately prior to the Reincorporation converted to an equivalent award of the Company (collectively, the “Company Awards”) pursuant to the Plan. The Company Awards are subject to substantially the same terms and conditions as the Delaware Corporation Awards. In reaching the opinions set forth herein, we have examined and are familiar with originals or copies, certified or otherwise identified to our satisfaction, of such documents and records of the Company and such statutes, regulations and other instruments as we deemed necessary or advisable for purposes of this opinion, including (i) the Registration Statements and the Amendments; (ii) the Plan of Conversion; (iii) the Company’s certificate of formation; (iv) certain resolutions adopted by the board of directors of each of the Delaware Corporation and the Company; (v) the Plan; and (vi) such other certificates, Exhibit 5.1


 
Granite Ridge Resources, Inc. August 6, 2026 Page 2 instruments, and documents as we have considered necessary for purposes of this opinion. As to any facts material to our opinions, we have made no independent investigation or verification of such facts and have relied, to the extent that we deem such reliance proper, upon certificates of public officials and officers or other representatives of the Company. We have assumed (i) the legal capacity of all natural persons; (ii) the genuineness of all signatures; (iii) the authority of all persons signing all documents submitted to us on behalf of the parties to such documents; (iv) the authenticity of all documents submitted to us as originals; (v) the conformity to authentic original documents of all documents submitted to us as copies; (vi) that all information contained in all documents reviewed by us is true, correct and complete; and (vii) that the shares of Common Stock will be issued in accordance with the terms of the Plan. Based on the foregoing and subject to the limitations set forth herein, and having due regard for the legal considerations we deem relevant, we are of the opinion that the shares of Common Stock have been duly authorized and, when the shares of Common Stock are issued by the Company in accordance with the terms of the Plan and the instruments executed pursuant to the Plan, as applicable, that govern the awards to which any shares of Common Stock relate, the shares of Common Stock will be validly issued, fully paid and nonassessable under the Texas Business Organizations Code (the “TBOC”). This opinion is limited in all respects to the TBOC. We express no opinion as to any other law or any matter other than as expressly set forth above, and no opinion as to any other law or matter may be inferred or implied herefrom. The opinions expressed herein are rendered as of the date hereof, and we expressly disclaim any obligation to update this letter or advise you of any change in any matter after the date hereof. This opinion may be filed as an exhibit to the Amendments. In giving this consent, we do not thereby admit that we come within the category of persons whose consent is required under Section 7 of the Act. Very truly yours, /s/ Vinson & Elkins LLP