In this paper we consider the inspection and maintenance of a two-component system with stochastic dependence. A failure of component 1 may induce the defective state in component 2 which in turn leads to its failure. A failure of component 1 and a defect in component 2 are detected by inspection. Our model considers a conditional inspection policy: when component 1 is found to have failed, inspection of component 2 is triggered. This opportunistic inspection policy is a natural one to use given this stochastic dependence between the components. The long-run cost per unit time (cost-rate) of the conditional inspection policy is determined generally. A real system that cuts rebar mesh motivates the model development. The numerical examples reveal that when the ratio of the cost of corrective system replacement, that is on failure, to the cost of preventive system replacement is large there exists a finite optimum policy in most cases. Moreover, for the studied system wherein inspections of component 2 are expensive relative to those of component 1, having a reliable indicator of the defective state in component 2 is a good strategy to avoid costly failures of component 2, particularly when its time to failure is short.