Every man has a Y chromosome, which is inheritted by his sons, usually with few mutations. This enables us to trace back biological male lines of ancestry.
The test utilizes small but pronounced differences at specific points in the DNA sequence. Most tests now use short tandem repeats (STRs), which are small repeated segments of DNA. For example, one person might have 20 repeats of a certain code, while others have 21. This number of repeats is passed down to offspring with good accuracy. These parts in the DNA that are tested are called markers.
If two people match at many of these markers, there is a good chance they are related. The more markers tested, the more likely you are able to draw a reliable conclusion. A 12-marker test is the bare mininum. If 2 people match at 12 out of 12 markers, there is a 50% chance they are related in the past 7 generations, a 90% chance they are related in less than 23 generations, and a 95% chance they are related in 29 generations.
It may well be correct that your relative is related in the way you describe, but I don't consider a 12/12 match to be very strong evidence. There is a chance they are related further back. I would think about upgrading the test to a 37 or higher marker test; at this level, if they match at 37/37 markers, you can be 95% confident that they are related in the last 7 generations.
See
Family Tree DNA FAQs for more information about the DNA tests and markers.
Alexander