Exhibit 5.1

August 25, 2023

Acasti Pharma Inc.

2572 boul. Daniel-Johnson, 2nd Floor

Laval, Québec, Canada H7T 2R3

Dear Sirs/Mesdames:

Registration Statement on Form S-8

We have acted as Canadian counsel to Acasti Pharma Inc. (the “Corporation”), a corporation governed by the Business Corporations Act (Quebec), in connection with the Registration Statement on Form S-8 (the “Registration Statement”) filed by the Corporation on August 25, 2023 with the U.S. Securities and Exchange Commission under the U.S. Securities Act of 1933, as amended, relating to the issuance by the Corporation of up to 1,483,140 common shares of the Corporation (the “Shares”) pursuant to the equity incentive plans listed on the cover of the Registration Statement (the “Plans”).

We have examined (a) the Registration Statement and (b) the Plans. We have also examined such public and corporate records, certificates and other documents and conducted such other examinations as we have considered necessary or relevant for the purposes of this opinion.

In giving this opinion, we have assumed the legal capacity of all individuals, the genuineness of all signatures, the authenticity of all documents submitted to us as originals and the conformity to authentic original documents of all documents submitted to us as certified, conformed, photostatic or facsimile copies.

In expressing this opinion, we have relied upon an officer’s certificate certifying copies of the resolutions of the board of directors of the Corporation dated August 25, 2023.

On the basis of the foregoing, we are of the opinion that when the Shares shall have been issued as contemplated in the Plans, including the receipt by the Corporation of the consideration therefor, the Shares will be validly issued, fully paid and non-assessable.

We express no opinion herein as to any laws or any matters governed by any laws other than the laws of the Province of Quebec and the federal laws of Canada applicable therein.

We hereby consent to the filing of this opinion as an exhibit to the Registration Statement. In giving such consent, we do not thereby admit that we are included in the category of persons whose consent is required under Section 7 of the U.S. Securities Act of 1933, as amended, or the rules and regulations of the Securities and Exchange Commission thereunder.

Yours very truly,

/s/ Osler, Hoskin & Harcourt LLP

Osler, Hoskin & Harcourt LLP