It kind of depends on your baseline.
If you have a reasonably healthy diet but are a total couch potato, you'll probably get more results by fitting in some exercise than by trimming away a few extra calories from your otherwise healthy diet.
If you have a manual labor job or the like, but eat half a package of bacon and 3 bowls of cereal for breakfast every morning, you'll probably see more results from cutting back on food than you will from going to the gym after your already physically intensive work day.
And I think it can also depend on your specific biology. Some people are extra sensitive to carbohydrates, so they'll tend to gain weight from the wrong diet, even if they can eat just as many calories with a different suite of macronutrients and lose weight. Some people are prone to very slow metabolisms, so they pretty much can't eat little enough to lose weight without risking serious malnutrition unless they exercise. And so on.
I don't think there's a one-size-fits-all answer to this one.