Yes. When it comes to ESTA all US territories are treated like mainland US. Therefore you always need to apply for ESTA.
I’m from Germany myself and I always needed an ESTA number to transit through the US.
Here are two links that should help (auf Deutsch 😉
Yes, you do need an ESTA. Puerto Rico has the same visa requirements as the mainland US (= ESTA needed for EU citizens), and like all other US airports, San Juan’s airport does not recognize the concept of visa-free transit.
Credit:stackoverflow.com‘