First, to understand who could beat Superman, we need to point out Superman’s weaknesses.
Even though Superman in invulnerable, he does have several weaknesses.
The first, and easiest to exploit is his weakness to Green Kryptonite (specifically the radiation), which saps him of his powers. Since this is something that takes away all of Superman’s powers, if anyone has this, they can beat him.
Using this weakness, any Green Lantern can use (established by Hal Jordan and Kyle Rayner, as well as Guy Gardner on a few occasions) their power ring to simulate Green Kryptonite Radiation against Superman. Firestorm, preferable one that has Dr. Stein in the Matrix would also be able to create Green Kryptonite to be used against superman. Captain Atom may be able to do this as well. Ray Palmer, the original Atom would be able to come up with something that could simulate this as well.
Lex Luthor and Batman have both been able to get their hands on Green Kryptonite, but really the only people that cannot use it on him would be Kara Zor-El (Superigrl), Krypto and Chris Kent.
Other forms of Kryptonite that can defeat Superman:
Red is a wildcard, and unknown what it may do to him, it can sometimes take away his powers, or cause them to go haywire.
Gold Kryptonite can permanently remove the powers of a Kryptonian. Element Boy of the Legion can create this.
Second, Superman has a weakness to Red Suns, which essentially drain him of his power he gains from a Yellow Sun, so anyone with powers that can manipulate this, would have an advantage.
Sunboy from the Legion has done this in a recent arc of Action comics.
Third, a big weakness is Magic. Anyone that has a good control over Magic would be able to stop Superman. This would include Zatanna, Zatarra, Dr. Fate, Spectre, Eclipso (on several occasions), the Marvel and Black Marvel families (As pointed out, Captain Marvel has fought Superman, with the one advantage of using his lightning change magic to put Superman down), as well as many others. Many members of the Shadowpact (and anyone that goes to the Oblivion Bar) and to some degree, Batman may have a spell or two set aside from his time of working with Zatanna.
Fourth, Superman is a solar battery, deplete his stored power, and you will be able to weaken him. This is how Doomsday beat him in a physical fight, to the point that Superman was actually killed. So, Doomsday could do this, Wonder Woman may be able to put up some level of fight, Power Girl, another Superman (such as Superman of Earth-2 or Superman of the Kingdom Come Universe, etc.), Lex in his battle Armor, Darkseid, Gog(has killed Superman before), Zod, Cyborg Superman, Orion of the New Gods, Martian Manhunter, Lobo, Eradicator, Ion (Sodam Yot),Superman Prime, or anyone with a large army that can keep Superman constantly exerting strength, especially if far from a Yellow sun so that he cannot re-charge.
Fifth, Superman is weak against psionics, especially mind control. In this case, you don’t need to kill Superman, when you can control him. Maxwell Lord, the Insect Queen, Martian Manhunter, Eclipso , and others have been shown to exploit this weakness.
Another weakness that can be exploited, Superman would not be able to escape easily from the Phantom Zone. Anyone with the projector could send him there, and he might not be able to get out. Also, Red Arrow, until recently, had a Phantom Zone Arrow in his possession, until he used it on Superman Prime.
But, if you combine any of these weaknesses, Superman could easily be bested. For Example, the Cyborg Superman (who is part Kryptonian through his own genetic manipulation) can use a Yellow Ring of the Sinestro Corps and keep beating up on Superman until he is depleted of power. Power Girl and Superman Prime (and any other universe Superman), are not of this universe, so even though they are Kryptonian, they are not weak to this Universes Green Kryptonite, and would be able to use it against Superman. Martian Manhunter is a near equal on the level of Strength, but if he can get into Superman’s Head, he would be able to beat him. Any Hero that uses a magic weapon would be able to weaken Superman. If Superman were to use up his power (like the battle with Doomsday or Superman Prime during Infinite Crisis) or he was under a Red Sun, he would be at a human level of strength and not have his invulnerability.
Wild Cards include the Flash. His speed would allow him to send some heavy hits into Superman, especially as a flash was able to fight alone for some time against the Anti Monitor. The Gurdians of the Universe, that control the Green Lantern Corps, they are more powerful than their Corp’s Members, and may be able to beat Superman. Brainiac has many cards up his slevese, and he migth be able to do something. As would Lex Luthor, and it might not just be due to using green Kryptonite.
As for Marvel counterparts? I am not sure as I do not know everyone in the Marvel Universe. Tony Stark and Reed Richards (and to some extent Hank Pym) would probably have the Batman money and the Ray Palmer skills to either buy or more likely build something that could attack Superman with Green Kryptonite Radiation. One of the Hulks would be able to fight Superman on equal footing. Thor has the strength and magical advantage like Captain Marvel. Any Mutant with mind control powers (Like Professor X back in the day) would be able to take control of Superman, and possibly could shut his powers off). Phoenix would be able to fight Superman, and having the telepathy advantage over him, would be victorious. Wolverine might be able to go toe to toe with Superman for a while, but it depends on which worked faster, mutant healing factor, or Yellow Sun recharge. Dr. Strange has the Magic on his side. Silver Surfer and Galactus have a good chance, with their cosmic powers.
So, many people can do it, depends a lot on who needs to do it, and why. If Superman goes Rouge, someone like Batman will be their to take him down, as has been shown in many battles (Dark Knight).
DC Comics Fan