The answer is "sometimes" (that's the kind of incisive analysis they taught in law school).
This is an issue of preemption, that is, does a federal law "preempt" the state law?
There is no one easy answer. If the specific federal law is designed to fully regulate the subject matter, then no state law more strict can be enforced and the federal laws are all that can apply. An example of this would be prescription drug approval. The FDA regulations are designed such that if a drug goes through the process and is approved, the drug is held to be safe and effective. A state law (or even lawsuit) cannot declare it otherwise. The only claim that can then be made against the drug manufacturer is that it was manufactured incorrectly (was not in compliance with what the feds approved) or that information was concealed from the feds in the approval process that would have affected the outcome. If the state wants a federally approved drug off the shelf- too bad.
A second kind of law would be a federal law is designed to provide an "outer limit", but leaving the door open for state regulation. In that case, the state laws can govern as long as they do not directly conflict with federal law. An example would be bumper heights on trucks. The feds set a range, but the state can set a narrower range because the feds have left that door open.
There is no way to tell which, if either, of these types of law you are dealing with without reading the text of the law itself. The law must expressly preempt state law or the federal law will be assumed to be an "outer limit".
...and then there's the issue of whether a given federal law was within Congress' power to begin with. Whether the law comes from Congress or from a federal agency (which is created by Congress), Congress must have been given the authority to make the type of law at issue in the Constitution. If Congress does not have the power, the law is invalid and cannot be enforced no matter what the text of the law says.
By the way- it does not matter who catches you doing whatever you do- any law enforcement officer can arrest you for a violation of an applicable law, federal or state, no matter what agency the officer is from.