Gastroscopy is highly effective in detecting cancers of the upper gastrointestinal tract. It allows for direct visualization of suspicious areas and the ability to take biopsies, making it a gold standard for diagnosing conditions like gastric cancer. Early detection through gastroscopy can significantly improve treatment outcomes and survival rates.