Yes, the secret is in the stackable headers.
And, while you've found a perfectly workable solution, the pins typically come out the bottom of the shield when assembled. It doesn't matter in this case but you may encounter shields with components that are too tall for the Digispark to be over the top. Here's an example of the nRF shield using stackable headers.