Exhibit (23)(b)

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” in the Registration Statement (Form S-3) and related Prospectus of S&T Bancorp, Inc. and subsidiaries for the registration of debt securities, preferred stock, depositary shares, common stock, and warrants of S&T Bancorp, Inc. and capital securities of S&T Capital Trust I, S&T Capital Trust II and S&T Capital Trust III and to the incorporation by reference therein of our report dated February 23, 2007, with respect to the consolidated statements of income, shareholders’ equity, and cash flows of S&T Bancorp, Inc. and subsidiaries for the year ended December 31, 2006, included in its Annual Report (Form 10-K) for the year ended December 31, 2008, filed with the Securities and Exchange Commission.

/s/ Ernst & Young LLP

Pittsburgh, Pennsylvania

August 14, 2009