Is there a way to detect the google key term so the banner only appears when the user types in a keyterm that is obviously for the previous owner?
Mechanically this is easy, but in practice I don't see how it can work.
If anyone arrives via keywords that point to your own site, it can only be because search engines have indexed the domain as it now exists, to there will no longer be any results for the old site.
Seems like what you'd really want to look out for is people coming in with no referer. Those are your bookmarks and type-ins who know the domain from before.
What about other referers? If there's no overlap between the previous owner's links and your own links, you can do the banner or redirect for anyone coming in from the old site's main referers. Also anyone asking for specific pagenames that you've no longer got. Your 404 page could have a section for "Are you looking for the widget store? They've changed their name to example dot com."