Magnesium as an Alternative to Lyrica. Many of the common things that Lyrica is prescribed for can actually be treated naturally just by improving your diet. Lyrica works by targeting the nerves all around your body, and often the pain of the nerves is actually just them crying out for magnesium.