I figure you have two broad options: one country gains magic or one loses it. They don't have to start with either magic or technology, perhaps they develop side by side.
Anyway, here are some ideas....
Given that you have expressed a desire for magic to be explained scientifically, having one side of an age-old conflict develop a technology that appears the same as magic would perhaps explain why both sides don't possess it. Only those inducted into the control mechanism of the magic can leverage it in any way. Perhaps there is an implant or imprinting that is required before they can access the magic.
Depending on how high tech you want the world to be at the time of your story you could have the advent of magic result in a near-apocalyptic war between the two nations, resulting in both being essentially beaten back to the stone age. The technology behind the 'magic' survives an enough people who know how to use it maintain the ability for the country as a whole.
Or perhaps the ability to use magic is gained as a mutation in a single genetic lineage. Genetic markers are another mainstay of magic use in a variety of SF&F, from the Comyn of Darkover to the Scions of Shannara. Specific genetics could translate to physical structures allowing one group to access magical energies and perform feats of magic that others cannot duplicate, with an obvious survival advantage making the gene more likely to spread. Users of magic might be ostracized and driven out, eventually forcing them to flee to their own country where they can practice their magic in peace.
This one gives you lots of room to play with. Assume that everyone has the ability to use magic at some point, now all you need is for one group to be somehow cut off from that ability.
For a technological magic there could be any number of ways that one group could be cut off, from the institution of security controls to the destruction of interfaces, perhaps even some sort of genetic key that someone must possess before they will be accepted by the technology (such as the Ancient gene in Stargate).
The use of magic might be restricted to a small segment of society - reserved for royalty or a priest class for instance - which is eventually corrupted to the point that they are overthrown by the peasant class. Everyone would potentially retain the ability to do some small magic, but none would have the training or ability to perform great feats of magic after potentially many generations of being forced not to.
Or perhaps the church decides that all magic is wicked and actively suppresses it wherever it is found, resulting in all magic use being stamped out in the area controlled by the church. Given enough time and strict enough suppression of magic, the whole area would be essentially devoid of anyone able to use magic.
Some (not particularly original) ideas on Tech Magery
Whether you're the Ship Who Won finding a world full of mentally-controlled alien machinery (and the humans who have stolen it from the rightful owners), a shaman in ADF's Cyber Way or a resident of the Well World technology as magic is far from a new idea.
Here are a few concepts that I've seen done with varying degrees of success:
Magic is a byproduct of alien technology that was intended for some other purpose but hijacked by humanity for selfish use, or subtly altered from its original purpose to serve as a font of power for certain people. (The aforementioned Ship who Won for instance.)
Science discovers that the universe is simply information and that it is possible to directly modify that information, sometimes only briefly, to produce some interesting effects. (The Ship of the Law from Anvil of Stars uses this.)
The world that the story portrays is a computer simulation running on some super computer, and all the people are simply unaware of this. Magic is what you get when you manage to get some control over the simulation. (You know, like the Matrix.)
A super-powerful computer (possibly the entire world) that is able to manifest physical-seeming fields of force (Holodeck-style) that are used to simulate the effects of magic. (Markovian ruins in the Well World saga, or the computer in Cyber Way.)
The universe is actually a projection maintained by a computer. Rather than being a simulation the computer is warping reality with its power. Interfacing in some way with the universe's control center gives you anything up to god-like power. (Especially if you're Nathan Brazil)
Engineered nano-machines allow anyone with the right mental keys to order them to do things, but nobody remembers that it's tech based or that the nano-machines even exist. The nano-machines have limited power but there are a lot of them, in everything, and they are quite happy to use your mitochondria as a power source, so don't draw too heavily. (Read Spell of Catastrophe for this one.)
Magic is simply latent human psi amplified by some suitable device, be it a Darkovan star-stone or some other technological psi amplifier. I'd say that the Tower and the Hive stories qualify here, although the amplification is actually done by the psi users themselves by drawing on electrical power, and they don't call it magic, but let's not quibble. (The device in The Forbidden Planet perhaps?)
Probability mechanics allows humans to manipulate reality in magical ways by changing the odds of things happening. By altering the odds of really bizarre things happening in a very small area and with just the right impetus you could cause any magical effect you can think of to become 100% likely to happen. Of course you'd need a computer the size of Jupiter to get all the calculations down just right. (Watch out for spontaneous Sperm Whales.)
Finally, the catch-all: It's science, but it's so advanced that I can't even begin to describe how it works. Just take my word for it, it's science, not magic. Honest. (If you can't find an example of this, you're not looking hard enough. Try Rama, or the Xeelee Sequence, or pretty much all of Known Space.)