Are those 2×4 or 4×4 posts? Can’t tell clearly.
If it’s 4×4. Just cut another 4×4 post on top and toenail it in. Add your lattice. Next, to reinforce the post extension, add a single 2×4 along both sides of the entire length of the existing and new post. If you can’t access your Neighbor’s side, a single 2×4 along your side should work.
Use exterior galvanized screws for the 2×4 to ensure a tight fit against the post.
I added a 2x8ft privacy lattice to my 5ft fence using this method and it works great.