Is it possible to restrict a change of a material's parameters to an overlapping volume?

I’m curious if it possible to restrict the change of a material’s parameters to an overlapping volume.

To give a specific example: I’d like to create a volume that follows the mouse, and as it overlaps a ground plane the specific region within the volume would have it’s parameters changed - while leaving the rest of the material outside the volume in it’s default state. As the volume moves away, the material parameters that fell within the volume would return to their default state.