Fill the 5-liter container, pour water from that into the 3 liter container until that is full, You will now have 2 liters left in the 5 liter container.
Empty the 3-liter container, and then transfer the 2 liters from the 5-liter container into it.
Now fill the 5-liter container again, then pour water carefully from the 5-liter container into the 3-liter container until it is full - exactly one more liter.
The 5-liter container now has 4 liters in it.