Narrative:

Departed ZZZ2 enroute to ZZZ1; planning to skirt just north of the ZZZ airspace; with two radios tuned to both unicoms. I shortly became distracted by two things. 1- a pilot on the ZZZ1 unicom was continuously asking if 'anyone was there.' more distracting was a traffic alert on my garmin 430 and a plane just behind me at my altitude. I elected to turn left and change altitude. Watching the other plane on my ads-B it appeared to turn with me. I know that the ads-B will sometimes show 'my shadow' but this had a distinct call sign. I soon noticed that my 'evasive' action had put me in the southwest corner of ZZZ's airspace. I then tuned one radio to ZZZ tower and turned northeast to exit that space. Further details are fuzzy because about 20 minutes later I lost all electrical power and was dealing with that situation.what should I have done? I usually ask for flight following and certainly intend to continue to do so. That probably would have prevented the unannounced incursion as well as hopefully taken the stress out of dealing with an unseen plane on my tail.

Google
 

Original NASA ASRS Text

Title: P28R pilot reported an airspace violation followed by a loss of electrical power.

Narrative: Departed ZZZ2 enroute to ZZZ1; planning to skirt just north of the ZZZ airspace; with two radios tuned to both UNICOMs. I shortly became distracted by two things. 1- A pilot on the ZZZ1 UNICOM was continuously asking if 'anyone was there.' More distracting was a traffic alert on my Garmin 430 and a plane just behind me at my altitude. I elected to turn left and change altitude. Watching the other plane on my ADS-B it appeared to turn with me. I know that the ADS-B will sometimes show 'my shadow' but this had a distinct call sign. I soon noticed that my 'evasive' action had put me in the southwest corner of ZZZ's airspace. I then tuned one radio to ZZZ Tower and turned northeast to exit that space. Further details are fuzzy because about 20 minutes later I lost all electrical power and was dealing with that situation.What should I have done? I usually ask for flight following and certainly intend to continue to do so. That probably would have prevented the unannounced incursion as well as hopefully taken the stress out of dealing with an unseen plane on my tail.

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.