Uno interfacing to system with scanned keypad

OK, the attached image illustrates what I'm talking about. I know it's crude, I just threw it together in MSPaint.

For simplicity, I've shown the existing retro system's key row / column hardware and keypad (here drawn in black) as just a 2 * 2 matrix. The original is actually a 4 * 8 matrix, but the hardware is otherwise the same.

The hypothetical added on Arduino which will give an electronic / automated means of pressing the keys is shown in red. The issue is that the outputs to the column lines can't have solid high / low drive like a normal digital output because that would interfere with the normal operation of the keypad. The outputs to the column lines need to be either hard pulldown, like an open-collector output turned on, or high impedance like an open-collector output turned off. The technique I have used on other microprocessors (ie, PIC) is to preload the port bit's output latch bit with zero and leave it that way, and then control the output by switching it between input mode and output mode.