You should upgrade other areas of that system first.
You can go to Userbenchmark.com and test your system there, and compare it to others like it.
https://www.userbenchmark.com/System/HP-Compaq-dc7900-Small-Form-Factor/2048
First the CPU.
If money is tight an E7500 and piece of tape will get you a 3.67GHZ 2 core for $5. But E8400, Q9400 or faster will work also.
http://www.overclockers.com/forums/attachment.php?attachmentid=68961&d=1225751188
Next the 3.5GB RAM.
Get 8GB in there minimum. This wil allow a 2GB GPU to work. The GPU uses system memory to cache textures. You don't have enough.
My thinking on GPUs for old computers is different than most people. It can be moved forward to a newer computer and will perform better there. If you buy old junk video cards they can't be reused, and your old computer won't be running at it's best. So personally I would save up for a 1050 series.
I would aim for at least a GTX750Ti low profile and only if you get a decent price. GTX1050 2GB is much better.
Only if you have 10- 12GB RAM on board would I get the GTX1050Ti4GB, or the GTX1650 4GB Low profile.
https://www.amazon.com/Gigabyte-GeForce-Graphics-Windforce-Gv-N1650OC-4GL/dp/B081L3PSGK
Don't bother with any card that doesn't have DDR5 memory.
If all of these are out of reach for you i would try for a GT730 1GB DDR5 card or maybe a GT1030. But they will probaly die along with the old computer.