I am reasonably sure that it will NOT work to change the netmask; if the netmask is wrong, then some things that need directed to the gateway/router will not be, and stuff will break.
I would try using 'route' to add a route to just add a route to the local computers on the local interface; try route add -host 24.5.xx.yy eth0 on one machine (with the other machine's IP address) or route add -net 24.5.xx.yy -netmask 255.255.255.255 eth0 (If the first command doesn't work). Note that eth0 must be replaced with the correct device name, and that you will have to fix BOTH computers before you can talk between them. Carl