Narrative:

Basically another pilot and I were flying to ZZZ. We were on flight following which we picked up after departing the ZZZ1 sfr. There was a commotion we overheard on the radio with a possible gear up landing of [some aircraft]. I don't know if this 'excitement' contributed to the workload of the TRACON controller who was doing a great job handling the issue. Nonetheless; while on flight following we received no call out of a traffic target that we would have at best come within a few feet of.I observed a plane approaching us on a direct collision course. Due to approaching at a roughly 60-degree angle and apparently at the same exact altitude; I did not want to turn us to the right or descend and possibly lose sight of the airplane when in a close proximity; fast closing speed; and similar altitude. We executed a quick climb - nothing directly evasive; as we had probably 15 seconds to take action; to gain as much altitude as possible and [to] keep the aircraft firmly in our sights. We quickly gained approximately 500 ft. They never responded; altered course; nor did they seem to notice us. There was no problem and the plane passed safely underneath. However; it was a concern as we were on flight following and it was a known ads-B target as were we. Had I not seen them who knows what may have happened.

Google
 

Original NASA ASRS Text

Title: C-172 Pilot Not Flying reported encountering an NMAC event during cruise while on flight following.

Narrative: Basically another pilot and I were flying to ZZZ. We were on flight following which we picked up after departing the ZZZ1 SFR. There was a commotion we overheard on the radio with a possible gear up landing of [some aircraft]. I don't know if this 'excitement' contributed to the workload of the TRACON Controller who was doing a great job handling the issue. Nonetheless; while on flight following we received no call out of a traffic target that we would have at best come within a few feet of.I observed a plane approaching us on a direct collision course. Due to approaching at a roughly 60-degree angle and apparently at the same exact altitude; I did not want to turn us to the right or descend and possibly lose sight of the airplane when in a close proximity; fast closing speed; and similar altitude. We executed a quick climb - nothing directly evasive; as we had probably 15 seconds to take action; to gain as much altitude as possible and [to] keep the aircraft firmly in our sights. We quickly gained approximately 500 ft. They never responded; altered course; nor did they seem to notice us. There was no problem and the plane passed safely underneath. However; it was a concern as we were on flight following and it was a known ADS-B target as were we. Had I not seen them who knows what may have happened.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.