EXHIBIT 23. CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We hereby consent to the incorporation by reference in the Registration Statement on Form S-8 (Nos. 333-115672 and 333-45249) and
Form S-3 (No. 333-200913) of Getty Realty Corp. of our report dated March 2, 2017 relating to the financial statements and the effectiveness of internal control over financial reporting, which appears in this Form 10-K.
/s/ PricewaterhouseCoopers LLP
New York, New York
March 2, 2017