Use a stud finder to locate studs beneath the stucco. Mark the location of the studs with a light pencil marking. Make a mark to show where each wooden fence post will go. Base the amount of posts on your specific wood fence panel measurements and the area of stucco you wish to cover.
Hold a wooden 4-by-4 fence post up to the stucco, against the stud. Position it so the bottom of the post touches the ground. Drill a pilot hole through the fence post and into the stucco beneath. Make the hole approximately 3 to 4 inches down from the top of the post. Screw a masonry screw into place in the pilot hole to attach the post to the stucco. Place two more screws in each post, one at the center and one 3 to 4 inches up from the bottom. Repeat this process for each fence post.
Line the wooden fence panels up with the posts. Drive size 18d nails through the wood fence panels into the posts beneath, avoiding the areas where the masonry screws are in the posts. Nail at the rate of one every foot up and down the fence post. Repeat the process on any other posts and panels.