Small Aircraft
Flight Crew Flight Instructor; Flight Crew Commercial; Flight Crew Instrument; Flight Crew Multiengine
Situational Awareness
ATC Issue All Types; Conflict NMAC
Flight Crew Took Evasive Action
Airspace Structure; Procedure
On departure from LGB; I was handed off early to switch to the practice area frequency. While still on with Tower; there was another aircraft with a gear indication problem. While still in Class D airspace over the [ship]; but on the practice area frequency; I noticed a fast approaching airplane on ADS-B. It was below us and climbing. I took controls from my student and told him to look for it since it was on his side of the airplane. I started a descent while looking for the airplane and lifted the left wing to have better visibility. We saw the airplane and I had to descend very quickly to make sure the airplane did not hit me while passing overhead. Both the other pilot and LGB Tower were obviously not looking out for traffic in their airspace.
Flight Instructor reported taking evasive action to avoid other traffic that had also departed from LGB airport.