Junior, I have communicated with various Cognex products over the years with 5/05's only. (1000,3000, etc)
The problem is with the 5/04's, is that the MSG format that the Cognex is expecting is not supported for ETHERNET within the processor as a native communication method. (There is only Serial/DH-485 and DH+)
You would have to be communicating via Serial tunneling....which I do not believe is possible in this case.
My first guess to your question would be NO, it is not possible.
Due to the fact that the Cognex relies on receiving MSG packets from the Ethernet port, (and not CIP type ethernet, TCIP only)
The only thing left to do if you have the components is try.
Let us know how you made out though.....