First of all, some effort is made to prevent contamination by earth organisms for precisely this reason, but it is not perfect.
But, if scientists do detect life it will probably be possible to tell that it is not of earthly origin. Here are some possible lines of evidence:
Biochemistry is complicated. We don't know that DNA is the only way genetic ...
One tool in the astrobiology toolbox is chirality, the property that many chemical compounds exist as "left-handed" and "right-handed" mirror images.
These have the exact same properties of course, as they are the exact same compounds. But biochemical processes will typically only be able to produce one of them.
Which means that if a ...
October 2020: It appears this barrier has been crossed with the identification of glycine in the atmosphere of Venus.
This link provides an abstract from which the pdf may be downloaded without a paywall. The title, authors and abstract are given below.
Detection of simplest amino acid glycine in the
atmosphere of the Venus
Arijit Manna,1 ...