Make the pump recognize that you want to pump oil instead of water when it is encountered. Found an underwater gusher and my pump found the oil and then started pumping water.
One of the first items I was looking for when I saw oil in a nearby ocean was actually the Water strainer...
Construct two tanks (Buildcraft glass tanks will do). Connect the pipe coming from the pump to both of them. Finally, place a bucket of oil in one and a bucket of water in the other tank.
But if you have 4 tanks, 2 for water and 2 for oil (one on top of the other) won't work, since if you put the bucket in one, it will put the oil on the top one.
You'll need to figure out a way to get rid of your water. For example, use a glacial precipitator to turn it into ice bocks, which you can then store (or send down a void pipe to delete).