Exhibit 5.1
DLA Piper LLP (US)
555 Mission Street, Suite 2400
San Francisco, CA 94105-2933
December 29, 2025
QT Imaging Holdings, Inc.
3 Hamilton Landing, Suite 160
Novato, CA 94949

| Re: | Registration Statement on Form S-1 of QT Imaging Holdings, Inc.

Ladies and Gentlemen:
We have acted as counsel to QT Imaging Holdings, Inc., a Delaware corporation (the “Company” and formerly known as GigCapital5, Inc.), in connection with the preparation and filing by the Company with the United States Securities and Exchange Commission (the “Commission”) of a Registration Statement on Form S-1 (Registration No. 333-291237) filed on November 3, 2025 (as amended, the “Registration Statement”) pursuant to the Securities Act of 1933, as amended (the “Securities Act”) for the offer and sale by the Selling Securityholders identified in the prospectus that is included in the Registration Statement of (i) 261,644 shares of Common Stock (the “First Common Shares”) that have been issued to certain of the Selling Securityholders who are “Purchasers” under the First Securities Purchase Agreement, dated April 9, 2025 (the “First Securities Purchase Agreement”), (ii) 68,447 shares of Common Stock (the “Second Common Shares”) that have been issued to certain of the Selling Securityholders who are “Purchasers” under the Second Securities Purchase Agreement, dated May 12, 2025 (the “Second Securities Purchase Agreement”), (iii) 2,232,243 shares of Common Stock (the “Third Common Shares” and together with the First Common Shares and Second Common Shares, the “Common Shares”) that have been issued to certain of the Selling Securityholders who are “Purchasers” under the Third Securities Purchase Agreement, dated September 30, 2025 (the “Third Securities Purchase Agreement”, and together with the First Securities Purchase Agreement and the Second Securities Purchase Agreement, the “S ecurities Purchase Agreements”), (iv) up to 24,442,342 shares of Common Stock (the “Five Year Common Warrant Shares”) that are issuable upon the exercise of the Common Stock purchase warrants with a term of five years from the initial exercise date (the “Five Year Common Warrants”, and such shares issuable upon exercise of the Five Year Common Warrants, the “Five Year Common Warrant Shares”), (v) 523,286 shares of Common Stock that are issuable upon the exercise of the Common Stock purchase warrants with a term of ten years from the initial exercise date (the “Ten Year Common Warrants”, and such shares issuable upon exercise of the Ten Year Common Warrants, the “Ten Year Common Warrant Shares”) and (vi) 1,808,055 shares of Common Stock that are issuable upon the exercise of the pre-funded warrants (the “Pre-Funded Warrants”, and such shares issuable upon exercise of the Pre-Funded Warrants, the “Pre-Funded Warrant Shares”). The Five Year Common Warrant Shares, the Ten Year Common Warrant Shares and the Pre-Funded Warrant Shares are collectively referred to as the “Warrant Shares”. Capitalized terms used herein but not otherwise defined herein have the meanings ascribed to them in the Registration Statement.
This opinion letter is being furnished in accordance with the requirements of Item 601(b)(5) of Regulation S-K under the Securities Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement or any prospectus included therein.
We have examined such documents and considered such legal matters as we have deemed necessary and relevant as the basis for the opinions set forth below, including (i) the Second Amended and Restated Certificate of Incorporation of the Company, filed as Exhibit 3.1 to the Registration Statement, and the Certificate of Amendment thereto, filed as Exhibit 3.3 to the Registration Statement; (ii) the Amended and Restated Bylaws of the Company, filed as Exhibit 3.2 to the Registration Statement; (iii) the Registration Statement; (iv) the Securities Purchase Agreements between the Company and the Purchasers, filed as Exhibits 10.37, 10.39 and 10.41 to the Registration

Statement; (v) the Warrant Agreement between Continental Stock Transfer & Trust Company and the Company, filed as Exhibit 4.1 to eh Registration Statement; (vi) the Warrant to Purchase Common Stock between the Company and Lynrock Lake Master Fund LP, filed as Exhibit 4.2 to the Registration Statement; (vii) resolutions adopted by the Board of Directors of the Company; and (viii) such other records, documents, and certificates as in our judgment are necessary or appropriate to enable us to render the opinions expressed below. With respect to such examination, we have assumed, without independent investigation, (i) the genuineness of all signatures on all documents; (ii) that each individual executing any document, whether on behalf of such individual or an entity, is legally competent to do so; (iii) the due authority of the parties signing any document on behalf of a party (other than the Company); (iv) the authenticity and completeness of all documents submitted to us as originals; (v) the completeness and conformity to the originals of all documents submitted to us as copies; (vi) that all public records reviewed or relied upon by us are authentic, accurate and complete; (vii) that all factual statements and information contained in any documents are true and complete; and (viii) that there has been no oral or written modification or amendments to any documents by action or omission of the parties or otherwise. We have also assumed that the offer and sale of the Common Shares and Warrant Shares complies and will comply in all respects with the terms, conditions and restrictions set forth in the Registration Statement. As to questions of fact material to this opinion letter, we have, to the extent deemed appropriate, relied upon certain certificates and representations of officers and employees of the Company.
Based upon the foregoing, and subject to the assumptions, qualifications and limitations set forth herein, we are of the opinion that when the Registration Statement becomes effective under the Securities Act:
1.The Warrant Shares are duly authorized, and when issued and delivered by the Company upon exercise of the Warrants in accordance with the terms thereof, will be validly issued, fully paid and non-assessable.
2.The Common Shares are duly authorized, validly issued, fully paid and non-assessable.
This opinion letter 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 Securities Act.
The opinions expressed herein are limited to the General Corporation Law of the State of Delaware (including the statutory provisions, all applicable provisions of the Delaware Constitution and the reported judicial decisions interpreting the foregoing). Our opinions are based on these laws as in effect on the date hereof and as of the effective date of the Registration Statement, and we assume no obligation to revise or supplement this opinion letter after the effective date of the Registration Statement should the law be changed by legislative action, judicial decision, or otherwise. We express no opinion as to whether the laws of any other jurisdiction are applicable to the subject matter hereof. We are not rendering any opinion as to compliance with any other federal or state law, rule or regulation relating to securities, or to the sale or issuance thereof. No opinion is expressed herein with respect to the qualification of the shares and warrants under the securities or blue-sky laws of any state or any foreign jurisdiction. The opinions expressed herein are limited to the matters set forth in this letter and no other opinion should be inferred beyond the matters expressly stated.
We hereby consent to the filing of this opinion letter as exhibit 5.1 to the Registration Statement, to the use of our name as your counsel, and to all references made to us in the Registration Statement. In giving our consent, we do not admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act or under the rules and regulations of the Commission promulgated thereunder (including Item 509 of Regulation S-K).

|  |  | Very truly yours, |
|  |  | /s/ DLA Piper LLP (US) |
|  |  | DLA PIPER LLP (US) |