Using Ground Off Another Circuit
Assuming you are located in the USA, you should be OK with this if you take certain precautions. 


On the outside chance your outlet is miswired somehow, check the voltages on its three receptacles with a voltmeter to verify the "middle" ground socket is actually at ground potential. 
Also, verify the extension cord is wired correctly. If it is a brand new store-bought unit there's little doubt, but if it looks like it's been repaired or is home made - beware!!!
In a standard USA 3-prong receptacle, a standard bannana plug will usually fit more-or-less correctly into the ground socket. So, you can use a standard test lead, or fashion a longer one, to bring the ground over to your other equipment.
In most cases in the USA you will find that the screw holding on a receptacle plate or the two screws holding on a switch plate are also connected to ground via the receptacle or switch. Verify this with a voltmeter check. You can then use a solder ring lug and wire to bring the ground over to your other equipment.


WARNING: You can NEVER be TOO CAREFUL when messing around with the AC POWER MAINS.