Making use of the boundary effect
Imagine if you will, a cylinder. In this cylinder there is a Spring, and a weight "above" this spring.
Lower this cylinder into the gravity field, and the weight will be pulled down to compress the spring.
Raise it back out of the field, and the spring will push the weight back up.
Converting a cylinder's movement into usable energy is something we're doing all the time, so I'll omit that step ;)
Note that if you don't want a spring that wears out, you can simply have a gas get compressed by the weight. A spring is simply easier to visualize.
Getting your experiment to the boundary and staying there
Here's the hard part. We have three options here:
Anchored on the ground
If the border isn't too far away from the ground, we might be able to just build a tower! After we're done building, we don't need to spend more energy on keeping it upright. Nice!
Floating above the border in gravity-less space
This is less ideal, and probably not doable. The bit of pull our entire assembly experiences every time we dip the cylinder into the gravity field and pull it back out will probably cost us more energy than we gain, especially if we have to convert it into thrust somehow.
In Orbit - this means flying very fast IN the gravity field.
Orbital mechanics 101: you stay in orbit if you go sideways just fast enough to miss the ground. Go a bit slower and you start getting near the ground, go a bit faster and you will slowly go higher. This does not cost any energy if you don't get slowed down by atmosphere (so I hope the border is very high up).
By orbiting just under the border you can push the cylinder out of the field above you to let the spring do its thing, and pull it back towards you to let gravity compress the spring again.