Limiting Feature Layer Popup based on another Feature Layer or Graphic?

I want all of my data to be displayed in a feature layer, but I only want a certain area defined by another Feature Layer or Graphic (I will call this the "Area of Interest Polygon" or AIP) to allow popups. Please see attached image for clarification

How do I override the feature layer's onclick to check if the point clicked is within the "AIP". Or if I place the "AIP" as the top level graphic layer how do I make it query the underlying feature layer?