I was able to get the example circuit below to work off the arduino pin but not a pin off the PCF8574.

I'm able to blink an LED from a pin off the the PCF8574 by connecting it like this ...
+5 ------- (+)LED(-) ------330 ohm Resistor-------- PCF8574 P0 pin 4
Using the following code ...
#include <Wire.h>
#define expander 0x20 //expander address with 3 address pins grounded
void setup() {
Wire.begin();
}
void loop() {
expanderWrite(B11111111); //turn all ports high
delay(1000);
expanderWrite(B00000000); //turn all ports low
delay(1000);
}
void expanderWrite(byte _data ) {
Wire.beginTransmission(expander);
Wire.send(_data);
Wire.endTransmission();
}
I think I understand why its working this way, but please someone correct me if I'm wrong. When the arduino turns an i/o port high it is sourced to positive and when the PCF8574 turns the i/o port high it sinks it to ground. (hope my terminology is correct as well).
If my thinking is correct then what do I need to change in order to get the relay circuit above to work with the PCF8574?