Do you need to put your wings at the center of gravity when building an airplane?
For supersonic speed, putting the wings near the center of gravity would be a good start. Even better, place the wing's center slightly aft of the center of gravity in a conventional configuration.



Lockheed F-104 in flight (picture source)

If you use rotating wings, placing their roots right above the center of gravity has worked well, too, especially if there is only one attachment point for them.



AS 355 Ecureuil helicopter (picture source)

If there is more than one attachment point, however, the rotating wings should be at opposite ends of the fuselage, quite a bit away from the center of gravity.



Boeing-Vertol CH-46 helicopter (picture source)

At subsonic speed it is advantageous to stretch the wings out sideways, so at least their tips are again quite a bit away from the center of gravity.



Nimeta single-seat glider (picture source)

And then there are some odd designs which try to separate the wings from the center of gravity as much as possible, and they still fly.



Rutan Proteus tandem wing (picture source)

So there is no general rule. Maybe these answers help to answer your questions about wing placement relative to the center of gravity.