Both cars sport a badge derived from the [prancing horse on the] Stuttgart coat of arms
Both cars are photographed alongside the Mediterranean
etc
it could be anything!
We do need a clue to narrow the field, eg is the connection :
in the name?
in the design?
in the history of the individual cars?
in the marketing?
or something else?
Actually you don't need a clue because you've got the answer straight off!
There can't be many (any?) things connecting these 2 cars except that black horse on a yellow background on their badges! Depending on which history you choose to believe it is, as you say, the same black horse on a yellow background which has its roots in Stuttgart's coat of arms.
The history of Porsche's use of it is clear, but there are 3 different versions of the Ferrari prancing horse, one of which is that Baracca, whose family asked Enzo Ferrari to use it, took it from the badge painted on the side of a downed aircraft whose pilot hailed from Stuttgart. Also another possible connection is that the Baracca family lived on a large estate with lots of horses, and it was named in honour of the city of Stuttgart, a name derived from the old word for a stud-farm, and which actually translates into Italian as 'Scuderia'! There is a third explanation of the prancing horse but we won't bother with that one..
So, well done and I didn't even get the chance to tell anyone they were wrong!
I doubt if there are all that many people beyond the world of AutoPuzzles who might be aware that both Porsche and Ferrari wear a logo which is derived from exactly the same horse!
The coat of arms of Stuttgart: