1271 Avenue of the Americas New York, New York 10020-1401 Tel: +1.212.906.1200 Fax: +1.212.751.4864 www.lw.com FIRM / AFFILIATE OFFICES Austin Milan Beijing Munich Boston New York Brussels Orange County Century City Paris Chicago Riyadh Dubai San Diego Düsseldorf San Francisco Frankfurt Seoul Hamburg Silicon Valley Hong Kong Singapore Houston Tel Aviv London Tokyo Los Angeles Washington, D.C. Madrid May 10,2024 BigBear.ai Holdings, Inc. 6811 Benjamin Franklin Drive, Suite 200 Columbia, MD 21046 Re: Registration Statement on Form S-3 (No. 333-217230); Shares of Common Stock, par value $ 0.0001 per share, having an aggregate offering price of up to $150,000,000 To the addressee set forth above: We have acted as special counsel to BigBear.ai Holdings, Inc., a Delaware corporation (the “Company”), in connection with the sale through Cantor Fitzgerald & Co., as sales agent (“Sales Agent”), from time to time by the Company of shares of common stock of the Company, par value $0.0001 per share (the “Common Stock”), having an aggregate offering price of up to $150,000,000 (the “Shares”), to be issued pursuant to a registration statement on Form S-3 originally filed by the Company with the Securities and Exchange Commission (the “Commission”) on April 12, 2024 (Registration No. 333-271230) (as so filed and amended, the “Registration Statement”), the base prospectus included in the Registration Statement (the “Base Prospectus”) and the related prospectus supplement, dated May 10, 2024, filed with the Commission pursuant to Rule 424(b) promulgated under the Securities Act (together with the Base Prospectus, the “Prospectus”), and that certain Controlled Equity OfferingSM Sales Agreement, dated May 10, 2024, by and between the Company and the Sales Agent (the “Sales Agreement”). This opinion is being furnished in connection with the requirements of Item 601(b)(5) of Regulation S-K under the Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement or the Prospectus, other than as expressly stated herein with respect to the issue of the Shares. As such counsel, we have examined such matters of fact and questions of law as we have considered appropriate for purposes of this letter. With your consent, we have relied upon certificates and other assurances of officers of the Company and others as to factual matters without having independently verified such factual matters. We are opining herein as to the General Corporation Law of the State of Delaware (the “DGCL”), and we express no opinion with respect to any other laws.


 
May 10, 2024 Page 2 Subject to the foregoing and the other matters set forth herein, it is our opinion that upon the completion of all Corporate Proceedings (as defined below) relating to the Shares, when the Shares shall have been duly registered on the books of the transfer agent and registrar therefor in the name or on behalf of the purchasers, and have been issued by the Company against payment therefor (not less than par value) in the circumstances contemplated by the Sales Agreement, the issue and sale of the Shares will have been duly authorized by all necessary corporate action of the Company, and the Shares will be validly issued, fully paid and nonassessable. In rendering the foregoing opinion, we have assumed that (i) the Company will comply with all applicable notice requirements regarding uncertificated shares provided in the DGCL, (ii) upon the issue of any of the Shares, the total number of shares of Common Stock issued and outstanding will not exceed the total number of shares of Common Stock that the Company is then authorized to issue under its Amended and Restated Certificate of Incorporation and (iii) certain terms of the Shares to be issued by the Company from time to time will be authorized and approved by the Board of Directors of the Company or a committee thereof established by the Board of Directors of the Company with the authority to issue and sell Shares pursuant to the Sales Agreement in accordance with the DGCL, the Company’s Amended and Restated Certificate of Incorporation, the Bylaws of the Company and certain resolutions of the Board of Directors of the Company and, as applicable, a committee thereof (such approvals referred to herein as, the “Corporate Proceedings”) prior to the issuance thereof. This opinion is for your benefit in connection with the Registration Statement and may be relied upon by you and by persons entitled to rely upon it pursuant to the applicable provisions of the Act. We consent to your filing this opinion as an exhibit to the Company’s Form 10-Q for the period ended March 31, 2024 and to the reference to our firm in the Prospectus under the heading “Legal Matters.” In giving such consent, we do not thereby admit that we are in the category of persons whose consent is required under Section 7 of the Act or the rules and regulations of the Commission thereunder. Sincerely, /s/ Latham & Watkins LLP