If cosmetics are not important, and you only have a few inches to fill between the sides of the speaker and its cubbyhole, then use the highest-density white mattress foam to fill that gap, to at least the depth of the speaker cabinet.
It is available from upholstery supply shops, or from many Army Surplus stores having a DIY upholstery-supplies department. At Surplus stores, expect to pay approximately a dollar per 12"x12"x1" (a board foot). They will cut it accurately to size while you wait, probably at no charge.
There are many thicknesses available, and you always "want the firmest white foam" they offer. It's often used in motorcycle seats, for example. It will soon turn yellow, but it will not crumble with age. Perhaps a seamtress could bag it in cloth for you?
Don't forget to put a large piece (several inches thick) loosely in the cubby space behind the speaker too.
Unlike most fiberglass panels, the absorption coeffients of this foam are high across most of the audible bandwidth, when used in this particular application.
While it would be useful to know more about the nature of your particular echo, there are few substitutes for this foam's near-full-range absorption of nearby reflections and cavity resonances that any bookshelf-mounted speaker produces. White mattress foam, in this "cubbyhole" application, has very effective results all the way down into the string-bass range, which fiberglass panels do not. It is best that the foam comes very close to filling that gap around the cabinet.
If there is not a true cubbyhole involved, but the speakers are still up against a wall or large panel, consider buying 3/4"-thick white foam, mounting it on 1/4" pegboard, and covering that all with cloth. A word of caution: Do not go thicker than 3/4" under the theory that "more is better". You will have too much bass absorption if you do.
Mount that 3/4" white foam to the pegboard with an appropriate spray adhesive (sprayed on the pegboard only), and then stretch the cloth over that. Spray 3M Scotch "76" adhesive onto the pegboard (not the cloth) to adhere the cloth to the backside.
When finished, either lean this assembly up behind the speaker, or stick on small bumper feet on its rear to space it off the wall when you hang it like a picture. That air-space behind the panel allows more sound absorption.
Ideally, this absorptive flat-panel would be at least 18" bigger than the speaker cabinet on each side, to make a dent in that first three milliseconds we need to "hear the music, not the reflections". It is probably not worth doing unless it can stick out at least a foot beyond the cabinet, at least to the sides.
Rich's suggestion about a trial using a thick towel is useful, and so is his info in his link above. I would note that placing the speakers with their tweeters outboard, or turning them upside down, results in the tweeter being farther from your ear than the woofer. This is important to natural sound, given how most speakers have a leading-phase shift in the treble. Toe-in would be the final tweak to that, of course.
Best of luck!
Founder and Designer
Green Mountain Audio