
<PAGE>   1
                                                                      EXHIBIT 5

            [GABLE GOTWALS MOCK SCHWABE KIHLE GABERINO LETTERHEAD]

                              November 26, 1997


ONEOK, Inc.
100 West Fifth Street
Tulsa, OK 74103

                                        Re:  Form S-8, Registration Statement
                                             Under the Securities Act of 1933,
                                             relating to Shares of the Common
                                             Stock of ONEOK, Inc. in Relation
                                             to Employee Stock Purchase Plan

Gentlemen:

     We are retained as regular counsel for ONEOK, Inc., an Oklahoma corporation
(hereinafter called the "Company") which has filed with the Securities and
Exchange Commission ("Commission") under the Securities Act of 1933, as amended,
a Registration Statement on Form S-8 relating to the registration of shares of
the Company's Common Stock, $0.01 par value, (the "Shares") for sale under the
ONEOK, Inc. Employee Stock Purchase Plan (the "Plan").

     We have examined (a) the above-mentioned Registration Statement which is
being filed with the Securities and Exchange Commission; (b) the Certificate of
Incorporation, and the By-laws, as amended, of the Company; (c) the Plan; (d)
the corporate actions taken by the Board of Directors of the Company in
connection with the issuance of the Shares; and (e) 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, we wish to advise you as follows:

     1.   The Company is a corporation validly organized and existing under the
laws of the State of Oklahoma.

     2.   The filing of the above-mentioned Registration Statement has been
duly authorized by the proper corporate action on the part of the Company.


     
<PAGE>   2
ONEOK, Inc.
November 26, 1997
Page 2



     3.   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 above-mentioned Form S-8 Registration Statement
and the documents constituting a Prospectus under Rule 428(a)(1) of the
Commission, and in any amendments thereto, under the caption "Experts" and
"Legality," as counsel for the Company, passing upon legal matters in
connection with the Shares and having reviewed the matters of law and legal
conclusions under "Description of Securities" contained in said Registration
Statement and documents which are included therein under our authority as
experts.

     2.   The filing of this opinion as an exhibit to the above-mentioned Form
S-8 Registration Statement.

                                             Very truly yours,

                                             GABLE GOTWALS MOCK SCHWABE KIHLE
                                             GABERINO



                                             By /s/ DONALD A. KIHLE
                                                --------------------------------
                                                Donald A. Kihle

DAK:bb
