Most writers (and by that, like most writers, I mean “most writers who are like me, but not the other ones”) don’t spend a lot of time before or during the writing of a particular piece in fretting about whether it’s straight science fiction/fantasy or magical realism. We write the story, and worry about determining its genre afterward — or we let the editor and the publisher and the readers worry about it, which is easier, and lets us get on to the next project.
There are a lot of theories about the difference between straight science fiction/fantasy and magical realism. For my money, the big difference between the two is that in straight sf/fantasy the non-realistic elements are meant to be regarded as actually there and actually happening (the elves are real and physically present elves; the spaceship is a real spaceship and not — or at any rate, not just –a metaphor for escape; the zombies really are a shambling undead menace and they really do want to eat your brains); but in magical realism, the non-realistic elements serve mainly as extended metaphors.
That’s an incomplete definition, of course. In my more cynical moments, I suspect that in the end the determination of the story’s genre will be done by whatever market you sell it to. If it goes to one of the mainstream markets — places like The New Yorker or The Atlantic† (hey, why not think big?) or one of the literary magazines — it’ll probably be classified as magical realism, or possibly as “slipstream” if they’re trying to be genre-friendly. If it goes to one of the sf/fantasy magazines, then it will be known as sf/fantasy for the rest of its natural life.
My own inclination, with an edge-case story like that, would be to try for the mainstream commercial magazines first, on the grounds that while they’re a long shot, they pay really well and publication there brings instant recognition. After that, unless I had a strong reason not to want my story identified as sf/fantasy, I’d probably bypass the literary magazines and go straight to the sf/fantasy mags, because by and large the literary magazines pay more in prestige than they do in cash.
†It used to be The Atlantic Monthly, but they changed the name after they stopped putting out twelve issues a year.