I would say Magneto would definitely be able to manipulate Shazams lightning because Dr Sivanna has proved time and time again that he has been able to manipulate the lightning with simple, science based machines. The magic doesn't matter
I don't know anything about nu52 Captain Marvel, but the classic CM is smarter and faster than he gets credit for - the dude has been depicted flying at interstellar speeds, that's way beyond anything Quicksilver's capable of...I'm also not entirely convinced that Magneto could affect the magic lightning.
Magnetos force fields have proved to be some of the strongest force fields on the planet. They can literally withstand multiple nukes at once. This provides him with more than enough enough of a defence against Shazam. Also Magneto is able to siphon and channel the energy from planets across the cosmos through their Magnetic fields allowing him to get stronger by the second. Essentially he can hit Shazam with multiple planets from across the cosmos all at once putting Magneto on par with Shazam in strength. With Magneto having complete control over the electromagnetic spectrum this allows him to be able to have at least minimal control over Shazams electricity which means Magneto could take control over Shazam. If not that, Shazam would still not be able to hurt Magneto with his electricity because Magneto has clearly shown many times that he can avoid and manipulate electricity from his battles with Storm. Magneto also has lots of experience with fighting speedsters since he's fought with his son Quicksilver so many times. Quicksilver is a character who could easily be on par with Shazams speed. Lastly Magneto has a genius level intellect. Not only is he one of the smartest people in the MU he's also one of the Marvel universes greatest strategists. Magneto isn't just a villain who is known for taking on a single hero like Dr Sivanna - he's known for taking on an entire TEAM single handedly. Magneto can easily outthink Shazam in brains and strategy in all ways especially with prep time and the fact that Shazam essentially lost all his wisdom and brain power in the new 52. If anything Shazam can even be considered a bad strategist now. Overall Magneto takes this battle home and wins. Everything I said before doesn't even account for the simple fact that Magneto can still throw metal beams and buildings at Shazam at alarming rates and turn the entire environment around Shazam against him. Magneto wins this battle hands down.