Let's look carefully at the situation where, in some formal system $S$, we have deduced a contradiction from an assumption $A$. There are two conclusions that people might want to reach in this situation: (1) $S$ proves "not $A$"; (2) $A$ is false.
Let's first look at (1). All the usual systems of propositional logic (not only classical logic but also intuitionistic logic) include the ability to infer "not $A$" from a proof of a contradiction under the assumption $A$. (In natural deduction systems, this ability amounts to the definition of negation. In Hilbert-style systems, this ability is more complicated, involving the deduction theorem.) So we get conclusion (1).
Now your objection is: What if $S$ is inconsistent and is "responsible" for the contradiction, while the assumption $A$ is an innocent by-stander? No problem, because an inconsistent formal system proves everything. In particular, if $S$ is inconsistent then it proves $A$. So conclusion (1) is still correct.
What about conclusion (2)? To get this conclusion (from a deduction of a contradiction using $S$ and $A$), we indeed need the consistency of $S$, as you suspected. In fact, we need more, namely that the system $S$ is sound, which means that any statement that $S$ can prove from true assumptions is itself true. Given soundness, we can use (1) and the fact that a contradiction is never true to conclude that $A$ is not true. So we get conclusion (2) if we know that $S$ is sound.
Knowing that a formal system $S$ is sound (or even the weaker fact that it's consistent) requires knowledge outside $S$ itself; that's the essence of the second incompleteness theorem. For example, I know that ZFC is sound because all its axioms are true when interpreted in the cumulative hierarchy of all sets, but that argument cannot be carried out within ZFC.
[I should acknowledge, before someone else points it out, that I have ignored paraconsistent and relevantist formal systems and also formal systems that are too weak to interpret basic arithmetic. I've also said that we need soundness to get (2), but in fact it would suffice to have partial soundness --- soundness for a class of statements that contains $A$. These points don't seem relevant to the question here, so it seems better to apologize here for ignoring them than to clutter the preceding paragraphs with enough caveats to make them true.]