I've done it two ways:
1) a small paint brush dipped in the stain and applied to the edges.
2) pouring the stain in a shallow pan or tray (i.e. dollar store cookie pan, Goodwill, etc.) and then laying the project in the stain. Remove the project and lay on a cloth and put another on top to remove excess stain. If necessary used compressed air or a small paint brush to remove remaining stain from the smaller spaces.
Karl