Temperature dependent Raman scattering measurements have been performed to explore unusual coupling between magnetism and crystal structure in doped pyrochlore iridate Y$_2$(Ir$_{1-x}$Ru$_x$)$_2$O$_7$ with $x$ = 0.0, 0.05 and 0.2. The parent Y$_2$Ir$_2$O$_7$ shows an onset of magnetic ordering around $\sim$ 160 K ($T_{N}$) which monotonically decreases with Ru doping. Further, magnetic moment also decreases with progressive substitution of Ru. Substitution of Ru$^{4+}$ (4$d^4$) for Ir$^{4+}$ (5$d^5$) does not introduce significant modification in structural parameters, however, the magnetic transition temperature decreases systematically with doping. Raman scattering data show an anomalous change in $A_{1g}$ and $P_3$ Raman mode frequency and line-width across $T_{N}$ of individual samples. We further show that the shifting of Raman mode frequency with temperature exhibits a strong deviation from anharmonic decay around and below the $T_{N}$ of respective samples which underlines a spin-phonon coupling in these materials.