Simulate 9 pin joystick output
I would isolate the two devices using opto-isolators.







simulate this circuit &ndash; Schematic created using CircuitLab

Turning the output ON will illuminate the infra-red LED in the opto-isolator which turns on the photo-transistor connecting the input to GND. Both devices are then completely galvanically isolated (unless of course you take power from the C64 for the Arduino).

Another option, if you don't care about galvanic isolation, is to just use a simple transistor (small signal NPN or logic level N-channel MOSFET) to make an Open Drain output:







simulate this circuit

Again, set the output HIGH and the transistor will turn on connecting the C64 input to ground.