In theory yes, in practice it's complicated.
On December 23 2022, President Biden signed Executive Order 14090: Adjustments of certain rate of pay. It sets the 2023 salary for the Speaker of the House of Representatives at 223,500 USD (see Section 3 and Schedule 6 in the appendix). Such an executive order comes about every year and is mandated by law.
In the Executive order and in the underlying 2 USC 4501 the Speaker is listed separately from Members, so it is reasonable to assume that the Speaker would be paid regardless of if they are a representative
However, there is also 2 USC 4502 which automatically appropriates the money necessary for the "Compensation of Members". It also specifies that
For purposes of this subsection, the term "Member" means each Member of the Senate and the House of Representatives, the Resident Commissioner from Puerto Rico, the Delegates from the District of Columbia, Guam, Virgin Islands, and American Samoa, and the Vice President.
This list does not include a Speaker of the House that is not a member so the funds for paying the salary of a non-representative Speaker would need to be appropriated separately.
This requires an appropriations bill, which (like every bill) needs to be passed by both houses of Congress and signed by the President. If the appropriations bill does not pass, the money can not be paid out, similarly to how federal employees won't be paid during a lapse in appropriations (government shutdown).
It stands to reason that the House of Representatives would negotiate a budget under which its Speaker gets paid but if it doesn't the money isn't there.