EXHIBIT 5 WEIL, GOTSHAL & MANGES LLP 100 Crescent Court, Suite 1300 Dallas, Texas 75201-6950 (214) 746-7700 (214) 746-7777 (fax) June 26, 1998 Berg Electronics Corp. 101 South Hanley Road, Suite 400 St. Louis, Missouri 63105 Ladies and Gentlemen: We have acted as counsel to Berg Electronics Corp., a Delaware corporation (the "Company"), in connection with the preparation and filing by the Company with the Securities and Exchange Commission (the "Commission") of a Registration Statement on Form S-8 to be filed with the Commission on or about June 26, 1998 (the "Registration Statement"), under the Securities Act of 1933, as amended, with respect to the offer and sale by the Company of up to 977,713 shares (the "Registered Shares") of the common stock, par value $.01 per share, of the Company issuable from time to time under the Company's 1998 Incentive Compensation Plan (the "Plan"). In so acting, we have examined originals or copies, certified or otherwise identified to our satisfaction, of the Registration Statement, the Plan, a form of award agreement to be utilized under the Plan and such corporate records, agreements, documents, and other instruments and such certificates or comparable documents of public officials and of officers and representatives of the Company, and have made such inquiries of such officers and representatives, as we have deemed relevant and necessary as a basis for the opinion hereinafter set forth. In such examination, we have assumed the genuineness of all signatures, the legal capacity of natural persons, the authenticity of all documents submitted to us as originals, the conformity to original documents of all documents submitted to us as certified or photostatic copies and the authenticity of the originals of such latter documents. As to all questions of fact material to this opinion that have not been independently established, we have relied upon certificates of officers and representatives of the Company. Based on the foregoing, and subject to the qualifications stated herein, we are of the opinion that when (a) the purchase price for the Registered Shares issuable under the Plan has been appropriately determined in accordance with the terms of the Plan and the provisions of the 1 General Corporation Law of the State of Delaware (the "DGCL") (including the provisions requiring the payment of consideration having a value not less than the par value of such shares); (b) each award under the Plan has been duly authorized in accordance with the terms of the Plan and the applicable provisions of the DGCL and the award agreement has been duly executed and delivered by the Company and the recipient of such award; and (c) such Registered Shares are issued and delivered in accordance with the terms of the Plan and the award agreement, such Registered Shares will be validly issued, fully paid and nonassessable. The opinion expressed herein is limited to the corporate laws of the State of Delaware and we express no opinion as to the effect on the matters covered by this letter of the laws of any other jurisdiction. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement. Very truly yours, 2