Connection For simulation touch using 1ch relay
The relay you are using is in fact a phototriac. This will not work for a DC application like yours.

What you need is an electromechanical relay, or, better, a transistor or phototransistor (as suggested in the link you provided).

EDIT

Please give this a try: