I know I'm late to this, but I had the same question so I thought I'd chime in now that I've figured it out! So I've read A Wrinkle in Time, great book but it's definitely not the one I think you're thinking of. The one you're thinking of probably sounds like this:
When Marco's shy and fragile little sister, Lilly, tells him about the strange lights in the basement, he thinks she's imagining things. But Marco is curious, and before long he investigates. He finds a passage into a strange world, where he meets insect-like creatures who seem to know all about Lilly. They believe she is special and beg Marco to bring her to them so that she can embark on a dangerous quest to save their world from ruin.
Can Marco help the creatures while protecting Lilly from harm?
That's the prequel book, called "Marco's Millions", and I remember reading that one.
Apparently the original (which is technically a sequel) has a female lead, and I honestly think I got parts of both books mixed up until I'd read the descriptions for both. I suddenly can't find a good description for it, so here's a brief one:
"Annie's Uncle Marco goes on one of his mysterious trips, leaving her in charge of two sealed boxes on one condition: she must not open either one while he is away. But she is tempted...and soon she has unleashed the unspeakable. The creatures inside the box are crab-like and grotesque. And they possess a power Annie could never have imagined: the power to transmute time. Sleator is the master of the creepy-crawly, and his inventiveness is at full power here."
For anyone interested, here's a longer description of Marco's Millions (which I think was the more popular of the two):
The book is about a boy named Marco who likes to travel. He often secretly rides buses far from home, though only his telepathic sister finds out. One day, his sister sees strange lights in the basement, and she and Marco investigate. They find a portal into another dimension, and thus the adventure begins. Marco finds strange insect-like creatures there, who are convinced that Marco/Lilly can save their dimension (and as a result save Earth) from their god, which is a naked singularity. None of their family members know about this portal, so Lily and Marco secretly need to save this dimension. Time is valued differently than on Earth in that universe, as 1 minute on the other dimension is roughly 21 minutes on Earth. Saving the other dimension would be being missing for several days on Earth. So, Marco tells his parents he going to his friend Nat's for vacation, while he'll actually be in the other dimension. The creatures (who communicate telepathically) tell Marco he must go on a giant swing and retrieve a small bag at the very top. This will be risking Marco's life. He retrieves the bag and brings it back to the ground. Next, he must go to the naked singularity and bribe it not to destroy the universe by giving it the contents in the bag. The singularity values the contents very much and says it will not destroy the universe, but with one cost.(continued in The Boxes)