Flight instructor on training flight with student reported NMAC with another aircraft also doing flight training.
Synopsis
Flight instructor on training flight with student reported NMAC with another aircraft also doing flight training.
Narrative
Aircraft X was departing ZZZ airspace; had crossed the north east side of the lake and was heading southbound when Aircraft Y crossed in close proximity westbound in front and above the aircraft. Aircraft Y came out from a blind spot left to right; was slightly higher and climbing when came to the attention of Aircraft X. Both aircraft were near the south tip of the lake . Upon noticing the aircraft; Aircraft X initiated a descent before leveling out and switching from practice area frequency back to Tower frequency (Aircraft X was outside of delta airspace and had changed frequency to practice area before the event). Aircraft X monitored Tower for a minute or so to see if there were any traffic calls that may have been missed; but nothing seemed awry and calls were being made to aircraft in the pattern per usual.Leading up the the event; instructor and student were discussing XC procedures and course of action for the next few minutes. Student was flying; and instructor was monitoring for traffic externally and via ads-b device/sentry connection to ForeFlight. While reviewing ForeFlight; instructor noticed traffic wasn't populating and reached in bag to grab and set sentry. Shortly after retrieving sentry; Aircraft Y passed in front and above Aircraft X. To prevent a situation like this in the future; instructor and student should verify proper function of ads-b device/sentry prior to takeoff. Instructor and student could also be more vigilant in scanning blind spots and monitor Tower frequency a minute or so longer before changing to practice area frequency.
Second reporter narrative
Aircraft Y went eastbound from ZZZ1 for student to get weather and radio call back to ZZZ in. Student made a left hand 180° turn back and was south of the Lake at 1900ft. ZZZ Tower then told aircraft Y to look for traffic at 9 o'clock to follow inbound. Both student and instructor looked for traffic. Instructor completed a quick full scan for traffic and then continued to look for 9 o'clock traffic. Instructor then did another full scan and realized that there was close proximity traffic at 3 o'clock departing ZZZ (aircraft X). They had already left delta airspace and were at a similar altitude. Instructor took controls and immediately started a climb.Looking back at how to better mitigate this risk; both instructor and student might have been too focused on trying to find the 9 o'clock traffic and may have not done a thorough job scanning for other traffic. There may have also been a blind spot issue looking for traffic at 3 o'clock earlier since it was at similar altitude. Usually tend to be lower for the arrival but hadn't initiated a descent down to 1500ft in order to look for the 9 o'clock traffic. Being at a lower altitude would have also helped mitigate risk for higher outbound ZZZ traffic
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.