This problem stumped me for 3+ years. I even considered building a shelf to put the dryer on. Then last week I figured it out: if I could attach pulleys to the ceiling and hoist the dryer a few inches upwards, then I could easily pull the washer out from underneath, which would both give me access to the back and would let me remove the top of the washer.

I'm leaving this Q&A pair here to help others with the same predicament. Here's the specific steps to make it work:
First, I cleared off some plaster and lath from the ceiling using a hammer, chisel, and jigsaw. At first I was going to drill through a joist horizontally, place a metal bar in the hole, and hang the pulleys from that. But I realized (unfortunately after making a big hole in the ceiling) that this was overkill.
Instead, I settled on using eye bolts screwed into the bottom of the joist: two 5/8" eye bolts to support double pulleys (each bearing about 65lbs) and one 3/8" eye bolt for a single pulley (bearing about 35lbs). Each eye bolt was rated for over 200lbs so I was pretty confident that they'd support the dryer.
Then I attached thick carabiners (apparently called "snap links" if you are googling) to the eye bolts, each rated for over 150+ pounds. And then attached double pulleys on the sides and a single pulley in between.
I used a 3/8", 244lb-rated rope for the pulleys, added two more pulleys below, and attached two more carabiners to those. Note that if the rope is attached below the pulleys, you'll need one more pulley above than below. That's why there needed to be 5 total pulleys on top vs. only 4 on bottom.
For the fixed ends of the rope, I attached a smaller (100lb-rated) eye bolt to the wood floor (in a corner where I could easily patch the hole later). For the moveable end of the rope, I attached a small rope cleat to inside of the closet door frame.
Then I attached some thick straps to the carabiners under the bottom pulleys. Then I tipped the dryer's front edge up a bit so I could slide the straps under the dryer.
Once this contraption was assembled I tried to lift the dryer... and only the front lifted because the washer and dryer were connected in back via a stacking kit.
It turned out that moving the entire stack forward 2 feet was pretty easy. I sat down, braced my leg on the door frame, opened the washer door, gripped the frame that was covered by the rubber boot, and pulled a few inches at a time, like I was rowing a heavy oar. The stack slid on the wood floor surprisingly easily. I slid some furniture sliders under the front legs of the dryer to avoid scratching the floor.
Once the stack was moved forward a bit, I could shimmy in back of the stack, unscrew the stacking kit, and then push the stack back under the pulleys. Finally I could hoist the dryer up in the air. Even though I was theoretically getting 9:1 leverage, it still was hard to lift. If I knew more about pulleys I suspect there's probably a better way to arrange the pulleys to make hoisting forces more even.
Tip: when you do lift it, you may want to have someone watch to make sure that the load stays level, because if one of the straps slips off the edge of a slippery dryer, then you'll have a very bad day.
Also, DO NOT attempt to run the dryer while it's hanging in the air. The vibration is likely to wiggle the straps off the edge and the dryer will topple.
I realized after I built this hacky contraption that it could be useful for other tasks. For example, if I needed to service or replace the dryer, I could lower it to the ground, and could use the same approach to raise up a new dryer. So I'm probably going to leave the winch in place for when I need it next. I gotta patch the hole though!
It was the most MacGyver thing I've ever built. I still can't quite believe that it worked.
Hope this post is helpful to others facing similar "lift something heavy that's on top of something else" problems.