EXHIBIT 5 Opinion and consent of Brobeck, Phleger & Harrison LLP June 5, 1998 Triangle Pharmaceuticals, Inc. 4 University Place 4611 University Drive Durham, NC 27707 Re: Registration Statement for Offering of an 1,000,000 Shares of Common Stock Ladies and Gentlemen: We refer to your registration on Form S-8 (the "Registration Statement") under the Securities Act of 1933, as amended, of an additional 1,000,000 shares of the Common Stock of Triangle Pharmaceuticals, Inc. (the "Company") under the Company's 1996 Stock Incentive Plan. We advise you that, in our opinion, when such shares have been issued and sold pursuant to the applicable provisions of the 1996 Stock Incentive Plan and in accordance with the Registration Statement, such shares will be duly authorized, validly issued, fully paid and non-assessable shares of the Company's Common Stock. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement. Very truly yours, /s/ Brobeck, Phleger & Harrison LLP BROBECK, PHLEGER & HARRISON LLP