No it won't work.
The RD-M5120 uses the "MTB" 10/11 speed cable pull ratio.
Your 105 uses the traditional pull ratio, the one that was used for "MTB" 6-9 speeds and for "road" 6-10 speeds (exluding Tiagra 4700 and GRX).
The problem here is that it might be tricky to find a rear derailleur with clutch and traditional pull ratio. If you can find some old "MTB" 9-speed part then it will most likely work assuming the other parameters like big sprocket support and capacity are fine. If not, then you are probably limited to using GRX derailleur, but it uses the "road" 11-speed ratio even if used in 10-speed systems. So you have to replace your levers with GRX or Tiagra 4700 levers in that case.
What might help you is some dongle to translate the cable pull ratio. However, they are usually nearly as expensive as the rear derailleur itself!