Yes you can. You need a bit of software to perform the function of a proxy server. This is used on the gateway machine (the one connected to the internet).
The other two machines are set up to connect through the LAN to the IP address of the gateway machine.
One I have used successfully is the excellent 602Lan Suite from click here
Home use is free for up to 5 users.