Most modern engines have a knock sensor that the ECU uses to monitor fuel quality - the ECU constantly adjusts the ignition timing and other parameters (boost pressure, etc.) to be right at the threshold of knock.

It isn't surprising that you started hearing pinging when you switched to 91 from 87 - the engine was running with parameters that the ECU found that worked with 91 octane gas. If it doesn't stop, you either have a problem with the engine, or the gasoline you are using is <87 octane and the ECU can't pull enough timing to fix the issue.

Personally, I'd stop buying gas from whatever station you bought the "87" octane gas from and try another. I have a Subaru that needs 93 octane gas or it pings like crazy - some gas that is "93" octane works fine while gas from other stations results in mild detonation. It's possible that for whatever reason, your engine is slightly more sensitive to fuel quality than others on here.