Yes, either of them (and almost all other Shimano derailleurs of the era) will work with the shifters and cassette. They both use the same pull ratio and for the gear spacing the shifters just need to match (or with 7 to 8 speed be close enough) the cassette.