You need what is called a Cross-over cable.... but yes. These are not the same as regular CAT 5 cables.
I will edit this as it does appear confusing. Yes, you can connect a single cable between two PC's. No it cannot be done with a common CAT 5 cable unless going thru a switch/router. To avoid the switch or router, use a Cross-over cable.... also very common.