For example:
You can create static class called i.e. GameGlobals with static variable
public static GameObject lastPressedButton;
, and then, in your button script add into OnClick method ... GameGlobals.lastPressedButton = this;
Now you have access to last pressed object ( button) from all classes.