No, your not fine. To limit the magazine on a semi-auto it has to be so that it cannot be undone simply (without tools by hand), i.e. if the AR mag has a dowel in it then the bottom (floor plate) must be rivoted to the mag body, or a rivot must be inserted into the side of the mag body to not allow the follower past that, or the dowel must be permanently attached to the follower and move with it. In your example of a shotgun, if you have the extension on using a dowel to limit capacity, you have to make it so that it cannot be simply unscrewed to remove the dowel. You would have to make it more of a physical barrier to your follower to go past the 5 round mark, like a rivot in your actual mag tube. My advice? your mag tube once you remove the cap, should have a retainer that holds the spring in place that you would also need to unscrew if you wished to remove it. If this is the case, just leave all that as is, (so no longer spring is put in) so you are just using the extension piece as a new long cap. That way if you are ever hassled, you can just remove it and the cop will see that the original (plastic) retainer is in place so that no more than 5 rounds can fit it and that there is no extra long spring and that nothing but air is ever in that "long cap".
This is a completely different deal than limiting the mag for hunting purposes (where/when required). That can be just a dowel inserted temporarily for the hunt (which is what I think stainless meant in his post).