In this paper, we examine the influence of the background’s stochastic excitations on an output power generated by using an energy harvester. The harvester is composed of two magnets attached to a piezoelastic oscillators separated by a distance Δ from the static magnets fastened directly to the device. We also introduce the parameter α which describes the mass ratio of moving magnets. We examine the output power for different excitation frequencies, different values of α, and different amplitudes δ0 of the stochastic force. We also analyze the influence of δ0 and Δ on the effective output power (EOP), the mean value of output power averaged over the considered frequencies, produced by using the harvester. We have observed that increasing δ0 causes the growth of generated mean power, especially in the low-frequency regime, while the maximum power near the resonance frequency remains unchanged. The EOP also grows with increasing δ0 for all examined values of α. The environment’s stochastic behavior improves slightly the harvester’s efficiency as compared to the purely harmonic case. Analyzing the dependence of EOP on Δ, we observed the maximum which appears at values of Δ corresponding to the situation when the system starts to work in the unsynchronized regime.