EX-5.1 4 a2143513zex-5_1.htm EXHIBIT 5.1
QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

DAVIS POLK & WARDWELL
450 LEXINGTON AVENUE
NEW YORK, NY 10017
212-450-4000

September 15, 2004

CVS Corporation
One CVS Drive
Woonsocket, RI 02895

Ladies and Gentlemen:

        We have acted as special counsel to CVS Corporation, a Delaware corporation (the "Company"), in connection with the Company's offer (the "Exchange Offer") to exchange its 4% notes due September 15, 2009 and its 47/8% notes due September 15, 2014 (collectively the "New Notes") for any and all of its outstanding 4% notes due September 15, 2009 and its outstanding 47/8% notes due September 15, 2014 (collectively the "Old Notes"). The New Notes will be subject to a Registration Statement on Form S-4 (the "Registration Statement"). The Old Notes were issued, and it is proposed that the New Notes be issued, under an indenture dated as of September 9, 2004 between the Company and The Bank of New York, as trustee (the "Trustee") (as may be supplemented or amended from time to time, the "Indenture").

        We have examined originals or copies, certified or otherwise identified to our satisfaction, of such documents, corporate records, certificates of public officials and other instruments as we have deemed necessary or advisable for the purpose of rendering this opinion.

        Upon the basis of the foregoing, we are of the opinion that the New Notes have been duly authorized by the Company and, when authenticated, executed and delivered in accordance with the terms of the Exchange Offer and the Indenture, will be valid and binding obligations of the Company, enforceable in accordance with their terms, subject to applicable bankruptcy, insolvency and similar laws affecting creditors' rights generally, equitable principles of general applicability and concepts of reasonableness.

        We hereby confirm that the discussion set forth under the caption "Material United States Tax Consequences of the Exchange Offer" in the prospectus that is part of the Registration Statement on Form S-4 filed by the Company with the Securities and Exchange Commission on September 15, 2004 constitutes our opinion as to the matters set forth therein.

        We are members of the Bar of the State of New York, and the foregoing opinion is limited to the laws of the State of New York, the federal laws of the United States of America and the General Corporation Law of the State of Delaware.

        We hereby consent to the filing of this opinion as an exhibit to the Registration Statement relating to the Exchange Offer. We also consent to the references to us and the use of the name of our firm under the caption "Material United States Tax Consequences of the Exchange Offer" and "Legal Matters" in the prospectus contained in such Registration Statement.

        This opinion is rendered in connection with the above matter.

                        Very truly yours,

                        /s/ Davis Polk & Wardwell




QuickLinks