EX-5.1 5 a2060505zex-5_1.htm OPINION GARY WOLTER Prepared by MERRILL CORPORATION
QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

[Letterhead of Gary J. Wolter, Esq.]

October 5, 2001

Madison Gas & Electric Company
133 South Blair Street
Madison, Wisconsin 53703

Ladies and Gentlemen:

    I am President and Chief Executive Officer of Madison Gas and Electric Company (the "Company") and an attorney licensed to practice law in the State of Wisconsin. In that connection, I am familiar with the filing of a Registration Statement on Form S-3 (the "Registration Statement") relating to shares of Common Stock, par value $1 per share, of the Company ("Common Stock") which may be purchased under the Company's Dividend Reinvestment and Direct Stock Purchase Plan (Investors Plus Plan)(the "Plan").

    I am also familiar with the Restated Articles of Incorporation and the By-Laws of the Company and all amendments thereto and resolutions of the Board of Directors of the Company relating to the Plan and the Registration Statement.

    In this connection, I have examined or caused to be examined and am familiar with originals or copies, certified or otherwise identified to my satisfaction, of all such records of the Company and others as I have deemed necessary or appropriate as a basis for the opinions set forth herein. In my examination, I have assumed the genuineness of all signatures, the authenticity of all documents submitted to me as certified or photostatic copies, and the authenticity of the originals of such latter documents. As to any facts material to the opinion expressed herein which were not independently established or verified by me, I have relied upon statements and representations of certain officers and other representatives of the Company and others.

    Based upon the foregoing, I am of the opinion that:

    1.  The Company is duly incorporated and validly existing under the laws of the State of Wisconsin.

    2.  Any shares of Common Stock purchased by an independent agent selected by the Company on the open market for the consideration provided in the Plan are legally issued, fully paid and non-assessable, except to the extent that such shares are assessable as provided in Section 180.0622 of the Wisconsin Business Corporation Law.

    3.  If the Company's Board of Directors, or a duly authorized committee thereof, and the Public Service Commission of the State of Wisconsin authorize the issuance of authorized and unissued shares of Common Stock for the consideration (but not less than the par value) provided in the Plan, such shares will, when certificates representing such shares shall have been duly executed, countersigned and registered, and duly delivered against the receipt by the Company of the consideration provided in the Plan, be legally issued, fully paid and non-assessable, except to the extent that such shares are assessable as provided in Section 180.0622 of the Wisconsin Business Corporation Law.

    4.  If the Company legally and validly reacquires issued and outstanding shares of Common Stock and thereafter, pursuant to the authorization by the Board of Directors or a duly authorized committee thereof, resells such issued but not outstanding shares for the consideration (but not less than par value) provided in the Plan, such shares will upon delivery against receipt by the Company of the consideration provided in the Plan, be legally issued, fully paid and non-assessable, except to the extent that such shares are assessable as provided in Section 180.0622 of the Wisconsin Business Corporation Law.


    I do not find it necessary for the purposes of such opinions to cover, and accordingly I express no opinion as to the application of the securities or blue sky laws of, the various states to the sale of shares of Common Stock.

    Such opinions are limited to the General Corporation Law of the State of Wisconsin. I assume no obligation to update or supplement this opinion to reflect any facts or circumstances which may hereafter come to my attention with respect to the opinions expressed above, including any changes in applicable law which may hereafter occur. I hereby consent to the filing of this opinion letter as an exhibit to the Registration Statement.

    Very truly yours,

 

 

/s/ Gary J. Wolter

Gary J. Wolter
President and Chief Executive Officer



QuickLinks