(b) Where any tax imposed hereunder shall have been erroneously, illegally or unconstitutionally assessed or collected and application for the refund or revision thereof duly made to the proper fiscal officer or officers, and such officer or officers or, in the case of a city of one million or more which has established a tax appeals tribunal, such tax appeals tribunal, shall have made a determination denying such refund or revision, such determination shall be reviewable by a proceeding under article seventy-eight of the civil practice law and rules, provided, however, (1) that such proceeding is instituted within four months after the giving of the notice of such denial, (2) that a final determination of tax due was not previously made, and (3) that an undertaking is filed with the proper fiscal officer or officers in such amount and with such sureties as a justice of the supreme court shall approve to the effect that if such proceeding be dismissed or the tax confirmed, the taxpayer will pay all costs and charges which may accrue in the prosecution of such proceeding.