I've rebuilt both of my gauge/caps. It was pretty easy, after giving my Yanmar dealer a phone call the parts were on the way. Don't know about your model, but of course the dealer will. It sure wouldn't surprise me if the parts were the same for all of the caps. There is a gasket, maybe a rubber ring, and a new lens. I think I also had a cracked plastic ring that also needed replacing. While in there, you can even go nuts and clean the gauge face so it is legible again. Oh, be sure to get it all sealed up tight. Rain water or dew that collects on top of that cap is known to find its way down past the gauge face and into the fuel tank where it degrades the fuel and causes rough running.
Snooks, even if the JD dealer accidentally had parts that you could make do with, I've found that the Yanmar prices are better. And of course OEM parts fit up properly.