My GSDs both did the same thing around that age (5-10 months or so). I found that "flooding" (continuously putting them around other dogs) did not help. What helped was just keeping our distance from that distraction, developing a close bond, training the dog how to train and learn that training was fun, and letting the dog mature. In both dogs' cases at around age 10 months the problem had basically disappeared. Both dogs live with other dogs and passed their CGCs around the age of 10 months. I personally would not make a huge issue of it. They are young and their brains really immature at this stage so I would not ask very much as far as distractions. Set the dog up for success at home or in wide open areas and let the dog mature and gain confidence working with you. I do correct this behavior when it happens but at this age I don't try to work on this "problem" by seeking out other dogs, if that makes sense? At this age it's more important to me that the dog and I are developing trust and confidence in each other than the dog being an angel around other dogs.

At age 6 months Nikon was a terror around other dogs, I could not even walk him around the block b/c if he saw another dog he'd flip out and throw this amazing fit which ended in him basically howling and chattering his teeth. Now, he runs on flyball teams (a dozen dogs screaming and chasing balls and toys often jumping over each other and crashing into each other) and he is absolutely wonderful to all the foster dogs I've brought into my home including another male GSD and several very pesky puppies. He just went through this stage where he completely lost it around dogs he didn't know but honestly I think he outgrew it after a few months. I could not control his reaction once it started so I kept him away from dog distractions and worked on obedience at home. A few months later he passed his CGC.