EXHIBIT 5 [LETTERHEAD OF GABLE & GOTWALS APPEARS HERE] January 20, 2000 ONEOK, Inc. 100 West Fifth Street Tulsa, OK 74103 Re: S-8 Registration Statement Under the Securities Act of 1933, Relating to the Shares of Common Stock of ONEOK, Inc. in Relation to the ONEOK, Inc. Employee Stock Purchase Plan Gentlemen: We understand that ONEOK, Inc., an Oklahoma corporation (hereinafter referred to as the "Company"), will file with the Securities and Exchange Commission under the Securities Act of 1933, as amended, a Form S-8 Registration Statement relating to the registration of shares of the Company's Common Stock with respect to the ONEOK, Inc. Employee Stock Purchase Plan (the "Plan"). We have examined (a) the above-mentioned Registration Statement which will be filed with the Securities and Exchange Commission; (b) the Certificate of Incorporation and Bylaws of the Company, as amended; (c) the ONEOK, Inc. Employee Stock Purchase and the corporate actions taken by the Board of Directors in connection with the Registration Statement and related matters; and (d) such other corporate records, certificates of public officials and officers of the Company and other documents as we have considered relevant to the matters covered by this opinion. In connection with the foregoing, as counsel for the Company, we wish to advise you as follows: 3. The Company is a corporation validly organized and existing under the laws of the 1 ONEOK, Inc. January 20, 2000 Page 2 State of Oklahoma and is duly qualified to do business as a corporation in the State of Kansas. 4. The filing of the above-mentioned Registration Statement has been duly authorized by the proper corporate action on the part of the Company. 5. Assuming the Shares are being issued in compliance with the terms and conditions of the Plan, when the certificates for the Shares have been executed by the proper officer of the Company, countersigned by the Transfer Agent and registered by the Registrar thereof, the certificates for such Shares will represent, and the Shares will constitute, duly authorized, legally issued, fully paid, non-assessable, valid and legal shares of the Common Stock of the Company. We hereby consent to: 1. Being named in the Form S-8 Registration Statement and documents constituting the prospectus which is being furnished, and in any amendments thereto, as counsel for the Company, passing on legal matters in connection with the issuance of the Common Stock to the Trustee under the Plan; 2. The making in the Form S-8 Registration Statement and documents constituting the prospectus, and in any amendments thereto, of the statements now appearing therein under the caption "interests of Named Experts and Counsel," insofar as they are applicable to us; and 3. The filing of this opinion as an exhibit to the above-mentioned Form S-8 Registration Statement. Very truly yours, GABLE & GOTWALS By Donald A. Kihle DAK:bb 2