Short answer: No
Longer answer:
I think that you have this backward. The real question is: How would something with gills develop a humanoid form.
If you are thinking of humans returning to the sea, look at all the dolphins, whales, manatee, and even snakes and turtles that returned to the water. How many of them developed gills?
The main thing is that evolution is not a leap from one form to another, it is a series of incremental steps that each, on their own, either provide a survival benefit or, at least, don't distract from it.
Even if all the changes that would have to take place simultaneously to make slits on in the side of the chest that led into the lungs (there are a lot of muscles between the ribs that actually have a purpose), would a baby survive like that? No, the lungs are not designed for pass through breathing.
If the lungs developed the structure for pass through breathing would a baby survive if there weren't slits for the air to actually pass out of? No.
Even if all of those changes happened at the same time, water has a much lower O2 content. Sharks get by by having a much lower metabolism than humans (that would involve a huge number of additional simultaneous changes).
Also, sharks don't have a human brain; which is the largest resource consumer in our bodies.
So, if you don't want to add the addition of a simultaneous change to make the humanoids mindless eating machines, you need to change the chest to have a much higher surface area for extracting O2. That means that the extraction surface would have to extend out of the slits (like some salamanders) and be vulnerable to attack or the chest would need to be much bigger. In that case, you would have a "humanoid" that was a head, arms, and legs sticking out of a huge ball of a chest. Also, remember that these changes have to all happen simultaneously also.
The likelihood of evolving gills is like winning the lottery (more than once) while being struck by lightning each time.
The answer that you need: Magic
Magic makes biology and physics tuck their tail between their legs and crawl away.