DNA sequencing is a significant technique to detect genetic illnesses and various diseases. Quick, accurate, and low cost DNA sequencing approach would revolutionize medicine. In this paper, a two-terminal z-shaped sensor with a nanogap is designed and studied to detect the DNA sequence. The z-shaped sensor is made of two metallic zigzag graphene nanoribbon (ZGNR), a semiconducting channel made of armchair graphene nanoribbon (AGNR), and a nanogap in the middle of the channel whose edge carbon atoms are passivated by either hydrogen or nitrogen. Placing a DNA base into the nanogap impacts the charge density of the sensor leading to unique signature for each of the four DNA bases. The z-shaped sensor performance was studied by non-equilibrium Green's function combined with density functional theory (NEGF+DFT). The transverse current and the transmission spectrum of the DNA bases within the nanogap are investigated with variation in the base orientation. The proposed sensor is highly useful for real application of quick, low-cost, and accurate DNA detection.