1
                                                                       EXHIBIT 5



                           [BAKER & BOTTS LETTERHEAD]



                                                              September 15, 1999

Cabot Oil & Gas Corporation
15375 Memorial Drive
Houston, Texas 77079

Gentlemen:

                  As set forth in the Registration Statement on Form S-3
(Registration No. 333-83189) (the "Registration Statement") filed by Cabot Oil &
Gas Corporation, a Delaware corporation (the "Company"), under the Securities
Act of 1933, as amended (the "Act"), relating to (i) unsecured debt securities
of the Company ("Debt Securities"), (ii) shares of preferred stock, par value
$.10 per share, of the Company ("Preferred Stock"), (iii) shares of Class A
common stock, par value $.10 per share, of the Company ("Common Stock") and (iv)
warrants to purchase other securities ("Warrants," and, together with the Debt
Securities, the Preferred Stock and the Common Stock, the "Securities") that may
be issued and sold by the Company from time to time pursuant to Rule 415 under
the Act for an aggregate initial offering price not to exceed $400,000,000,
certain legal matters in connection with the Securities are being passed upon
for you by us.

                  In our capacity as your counsel in the connection referred to
above, we have examined (i) the Certificate of Incorporation and By-Laws of the
Company, each as amended to date (together, the "Charter Documents"), (ii) the
form of Indenture filed as Exhibit 4.3 to the Registration Statement to be
executed by the Company and the trustee thereunder (the "Senior Debt Indenture")
pursuant to which senior Debt Securities may be issued, (iii) the form of
Indenture filed as Exhibit 4.4 to the Registration Statement to be executed by
the Company and the trustee thereunder (the "Subordinated Debt Indenture")
pursuant to which subordinated Debt Securities may be issued, and (iv) the
originals, or copies certified or otherwise identified, of corporate records of
the Company, certificates of public officials and of representatives of the
Company, statutes and other instruments and documents as a basis for the
opinions hereafter expressed.

                  In connection with this opinion, we have assumed that (i) the
Registration Statement, and any amendments thereto (including post-effective
amendments), will have become effective; (ii) a Prospectus Supplement will have
been prepared and filed with the Commission describing the Securities offered
thereby; (iii) all Securities will be issued and sold in compliance with
applicable federal and state securities laws and in the manner stated in the
Registration Statement and the appropriate Prospectus Supplement; (iv) a
definitive purchase, underwriting or similar agreement



   2


Cabot Oil & Gas Corporation           -2-                     September 15, 1999



with respect to any Securities offered will have been duly authorized and
validly executed and delivered by the Company and the other parties thereto; (v)
any securities issuable upon conversion, exchange, redemption or exercise of any
Securities being offered will be duly authorized, created and, if appropriate,
reserved for issuance upon such conversion, exchange, redemption or exercise and
(vi) with respect to shares of Common Stock or Preferred Stock offered, there
will be sufficient shares of Common Stock or Preferred Stock authorized under
the Company's Charter Documents and not otherwise reserved for issuance.

                  Based upon and subject to the foregoing, we are of the opinion
         that:

                  1. The Company is a corporation duly organized and validly
         existing in good standing under the laws of the State of Delaware.

                  2. With respect to shares of Common Stock, when (i) the Board
         of Directors of the Company or, to the extent permitted by the General
         Corporation Law of the State of Delaware and the Company's Charter
         Documents, a duly constituted and acting committee thereof (such Board
         of Directors or committee being hereinafter referred to as the "Board")
         has taken all necessary corporate action to approve the issuance
         thereof and the terms of the offering of shares of Common Stock and
         related matters, and (ii) certificates representing the shares of
         Common Stock have been duly executed, countersigned, registered and
         delivered either (a) in accordance with the applicable definitive
         purchase, underwriting or similar agreement approved by the Board upon
         payment of the consideration therefor (not less than the par value of
         the Common Stock) provided for therein, or (b) upon conversion,
         exchange, redemption or exercise of any other Security, in accordance
         with the terms of such Security or the instrument governing such
         Security providing for such conversion, exchange, redemption or
         exercise as approved by the Board, for the consideration approved by
         the Board (not less than the par value of the Common Stock), the shares
         of Common Stock will be duly authorized, validly issued, fully paid and
         non-assessable.

                  3. With respect to shares of Preferred Stock, when (i) the
         Board has taken all necessary corporate action to approve and establish
         the terms of the shares of Preferred Stock, to approve the issuance
         thereof and the terms of the offering thereof and related matters,
         including the adoption of a Certificate of Designations relating to
         such Preferred Stock (a "Certificate of Designations"), and such
         Certificate of Designations has been filed with the Secretary of State
         of the State of Delaware, and (ii) certificates representing the shares
         of Preferred Stock have been duly executed, countersigned, registered
         and delivered either (a) in accordance with the applicable definitive
         purchase, underwriting or similar agreement approved by the Board upon
         payment of the consideration therefor (not less than the par value of
         the Preferred Stock) provided for therein, or (b) upon conversion,
         exchange, redemption or exercise of any other Security, in accordance
         with the terms of such Security



   3


Cabot Oil & Gas Corporation           -3-                     September 15, 1999



         or the instrument governing such Security providing for such
         conversion, exchange, redemption or exercise as approved by the Board,
         for the consideration approved by the Board (not less than the par
         value of the Preferred Stock), the shares of Preferred Stock will be
         duly authorized, validly issued, fully paid and non-assessable.

                  4. With respect to Debt Securities to be issued under the
         Senior Debt Indenture, when (i) the Senior Debt Indenture has been duly
         authorized and validly executed and delivered by the Company to the
         trustee, (ii) the Senior Debt Indenture has been duly qualified under
         the Trust Indenture Act of 1939, as amended, (iii) the Board has taken
         all necessary corporate action to approve and establish the terms of
         such Debt Securities, to approve the issuance thereof and the terms of
         the offering thereof and related matters, and (iv) such Debt Securities
         have been duly executed, authenticated, issued and delivered in
         accordance with both the provisions of the Senior Debt Indenture and
         either (a) the provisions of the applicable definitive purchase,
         underwriting or similar agreement approved by the Board upon payment of
         the consideration therefor provided for therein or (b) upon conversion,
         exchange, redemption or exercise of any other Security, in accordance
         with the terms of such Security or the instrument governing such
         Security providing for such conversion, exchange, redemption or
         exercise as approved by the Board, for the consideration approved by
         the Board, such Debt Securities will constitute legal, valid and
         binding obligations of the Company, enforceable against the Company,
         except as the enforceability thereof is subject to the effect of (i)
         bankruptcy, insolvency, reorganization, moratorium, fraudulent
         conveyance or other laws relating to or affecting creditors' rights
         generally and (ii) general principles of equity (regardless of whether
         such enforceability is considered in a proceeding in equity or at law).

                  5. With respect to Debt Securities to be issued under the
         Subordinated Debt Indenture, when (i) the Subordinated Debt Indenture
         has been duly authorized and validly executed and delivered by the
         Company to the trustee, (ii) the Subordinated Debt Indenture has been
         duly qualified under the Trust Indenture Act of 1939, as amended, (iii)
         the Board has taken all necessary corporate action to approve and
         establish the terms of such Debt Securities, to approve the issuance
         thereof and the terms of the offering thereof and related matters, and
         (iv) such Debt Securities have been duly executed, authenticated,
         issued and delivered in accordance with both the provisions of the
         Subordinated Debt Indenture and either (a) the provisions of the
         applicable definitive purchase, underwriting or similar agreement
         approved by the Board upon payment of the consideration therefor
         provided for therein or (b) upon conversion, exchange, redemption or
         exercise of any other Security, in accordance with the terms of such
         Security or the instrument governing such Security providing for such
         conversion, exchange, redemption or exercise as approved by the Board,
         for the consideration approved by the Board; such Debt Securities will
         constitute legal, valid and binding obligations of the Company,
         enforceable against the Company, except as the



   4


Cabot Oil & Gas Corporation           -4-                     September 15, 1999



         enforceability thereof is subject to the effect of (i) bankruptcy,
         insolvency, reorganization, moratorium, fraudulent conveyance or other
         laws relating to or affecting creditors' rights generally and (ii)
         general principles of equity (regardless of whether such enforceability
         is considered in a proceeding in equity or at law).

                  6. With respect to Warrants, when (i) the Board has taken all
         necessary corporate action to approve the creation of and the issuance
         and terms of the Warrants, the terms of the offering thereof and
         related matters, (ii) the Warrant Agreement or Agreements relating to
         the Warrants have been duly authorized and validly executed and
         delivered by the Company and the Warrant Agent appointed by the
         Company, and (iii) the Warrants or certificates representing the
         Warrants have been duly executed, countersigned, registered and
         delivered in accordance with the appropriate Warrant Agreement or
         Agreements and the applicable definitive purchase, underwriting or
         similar agreement approved by the Board upon payment of the
         consideration therefor provided for therein, the Warrants will be duly
         authorized and validly issued.

                  We hereby consent to the filing of this opinion of counsel as
Exhibit 5 to the Registration Statement. We also consent to the reference to our
Firm under the heading "Legal Matters" in the Prospectus forming a part of the
Registration Statement. In giving this consent, we do not hereby admit that we
are in the category of persons whose consent is required under Section 7 of the
Act.

                                       Very truly yours,

                                       BAKER & BOTTS, L.L.P.


JDK/JKB