Skyhawk 172/Cutlass 172
Flight Crew Instrument; Flight Crew Flight Instructor; Flight Crew Commercial; Flight Crew Multiengine
Flight Crew Last 90 Days 109; Flight Crew Total 346; Flight Crew Type 291
Situational Awareness
Conflict NMAC
Flight Crew Took Evasive Action
Human Factors
My student and I were departing to a training area about 10 NM southeast of the ZZZ airport to a cruising altitude of 5;500 ft MSL to practice PPL[Private Pilot License] maneuvers per 61.107. We requested a right downwind departure holding short of Runway 34; which was approved. We then departed and as we were turning our crosswind leg; there was Aircraft Y behind us who also requested a right downwind departure; which was also approved. However; the Tower advised Aircraft Y of our presence in the traffic pattern departing on the same leg. Since we were just turning downwind as he began his takeoff roll; we had the traffic in sight. We continued our climb through the downwind leg and when we were abeam the runway numbers; we began our turn out toward the southeast with an approximate heading of 120. At this point; I no longer had Aircraft Y traffic in sight as he was behind us and we were beginning our turn to the training area with an expectation that he would be behind us. However; not long after we began our turn; as we were climbing through about 2;400 ft MSL; Aircraft Y barely missed us on his climb out below us as I believe he made a wider pattern. He responded to this near miss on the Tower frequency by saying; 'That was close!' He then came back on the Tower frequency to tell Tower that he had a near miss with us and the Tower advised him that he had already warned him of the traffic in the pattern departing on the same leg; and Aircraft Y replied that he never had us in sight. We continued to our training area with no further contact with this pilot as he continued southbound.
Cessna flight instructor reported loss of situational awareness caused a Near Mid Air Collision.