the question is whether some one with a multiple B2 visa valid for 5 years, after traveling to US in the first instance go to a neighboring country say Mexico on tourist visa taken from US and stay there (Mexico) illegally for 2-4 years and return to US and later go back to home country? will US Govt notice this illegal stay in Mexico and deny entry even if the B2 visa is valid and also such action will become a hurdle in applying for further B2 visa to US from home country?
If one can prove that they entered Mexico on a certain date (ie. with an entry stamp in a passport), then that should be sufficient proof for the US authorities to consider that this person exited the US on that date.
A several-year illegal stay in Mexico would probably arouse the suspicion of the US authorities, if they were made aware of it somehow (they may ask questions just based on inspection of a passport, and not finding Mexican visa paperwork). After all, they expect people to follow the US rules, and if a person does not follow Mexican rules, then they might be expected to not follow US rules as well. (This is why on various immigration related application forms, there is a question something like "Have you ever been denied entry to or removed from any country?")
The fact of the matter is this person did stay illegally in Mexico for several years. If the US authorities were to ask about that stay, this person should certainly answer truthfully. What decision the officer makes at that time will determine whether this person can be readmitted into the US.