Will an engine from a 1987 Z24 Cavalier automatic work in a 1989 Z24 Cavalier V6 stick?

Yes. They are the same from 1987 until 1990