Generalized Heegner cycles at Eisenstein primes and the Katz $p$-adic $L$-function