mikeselectricstuff has just beaten me to to it, but as he says you can emulate an open drain output by switching between output and input as required.
Below are my comments from an Arduino based GPIB program. Here I wanted an 'open drain' with a weak pull up.
// Asserted (Low state) digitalWrite(xx, LOW); pinMode(xx, OUTPUT), This way round to ensure output never 'glitches' to +5v
// Unasserted (High state) pinMode(xxx, INPUT_PULLUP), High by internal pullup only (20-50 kOhm)
Again as Mike said, beware the protection diodes to Vdd.
Jim