The present data on a number of observables in b -> s mu(+)mu(-) processes manifest some tensions with the standard model (SM). Assuming that these anomalies have a new physics origin, we consider the possibility that a Z' boson is responsible for them. We further assume that its interactions with quarks also affect rare nonleptonic decays of the (B) over bar (0)(s) meson which are purely isospin-violating and tend to be dominated by electroweak-penguin contributions, namely (B) over bar (0)(s) -> (eta, eta' phi)(pi(0) , rho(0)). Most of these decays are not yet observed, and their rates are expected to be relatively small in the SM. Taking into account constraints from various measurements, including the evidence for (B) over bar (0)(s) -> phi rho(0) recently seen by LHCb, we find that the Z' effects on (B) over bar (0)(s) -> (eta,phi)pi(0) can make their rates bigger than the SM predictions by up to an order of magnitude. For (B) over bar (0)(s) -> eta pi(0),(eta,eta')rho(0) the enhancement factors are at most a few. Since the Z' contributions to the different channels depend on different combinations of its couplings, observations of more of these decays in future experiments, along with improved b -> s mu(broken vertical bar) mu(-) data, will probe this Z' scenario more thoroughly.