Connect 2 pins or set a pin to the ground

Well if it was me I would buy a small relay with 2 separated pins and connect then on the N.O(Normally Open) side and with a small transistor connected to an arduino pin do the switch safely.This way you will separate the systems and voltage differences.
Then In arduino program all you have to do is set the pin low or High.
The extra hardware is cheap (relay, transistor,Diode and some resistors)
I don't think you can achieve this without a small circuit.