If I understand correctly the concept of a Minkowski space/metric was already known before Einstein's paper on special relativity. Was there any physical motivation for studying this type of metric spaces and how did Einstein become aware of these studies?
Not quite. Minkowski had the idea of representing special ralativity as geometry in 1907 under the direct influence of Einstein's 1905 paper, and he developed it in Raum und Zeit (1907) and Zwei Abhand lungen über die Grundgleichungen der Elektrodynamik (1909). See Minkowski on MacTutor. Before that only classical "spacetime" appeared, and only superficially. D'Alembert wrote in the Dimension entry of the Encyclopedia (1756):"One could consider time as a fourth dimension, so that the product of time by volume would, in a certain sense, be the product of four dimensions; this idea is perhaps debatable, but I feel that it has certain merits..." At the end of 19th century the idea became quite fashionable in the popular culture. In 1885 Nature published an unsigned letter Four-Dimensional Space, which read:
"Since this fourth dimension cannot be introduced into space, as commonly understood, we require a new kind of space for its existence, which we may call time-space... We must, therefore, conceive that there is a new three-dimensional space for each successive instant of time; and, by picturing to ourselves the aggregate formed by the successive positions in time-space of a given solid during a given time, we shall get the idea of a four-dimensional solid, which may be called a sur-solid... Let any man picture to himself the aggregate of his own bodily forms from birth to the present time..."
And in 1895 Wells, inspired by a fellow student at the Imperial college, immortalized it in his Time Machine, see When Einstein met H.G. Wells by Halpern.
Before Minkowski, what we call Minkowski geometry in two and three dimensions appeared on a long list of geometries in Klein's classification under his Erlangen program (1872). But it only came up as a collection of objects invariant under all transformations that preserve a quadratic form with indefinite signature. Erlangen Program in general was about interpreting geometries as invariants of various transformation groups acting on projective space, it greatly expanded the number of known homogeneous geometries from the originally discovered hyperbolic and elliptic ones. Unlike them however, it had no spatial interpretation. Before 1910 in his popularizations of the Erlangen program Klein only treated spatial geometries in any detail. Earlier he did not even count the total number of geometries his construction produced, and mentioned higher dimensional generalizations required for spacetime only in single sentences.
There is a connection to split complex numbers introduced by Cockle (1848) and studied by Clifford in 1873 under the name of double numbers. But that was mostly algebraic playing around, and the connection to Minkowski geometry was pointed out only after Minkowski. This is despite the fact that Clifford was deeply involved with non-Euclidean geometries, and his short note On the Space-Theory of Matter (1876) anticipated Einstein's idea of reducing matter to curvature (but of space, not spacetime). Even Poincare, who in 1905 expressed Lorentz's theory of ether (mathematically equivalent to special relativity) in terms of what we call Poincare group of transformations, and was well familiar with the Erlangen program, did not make the geometric connection either. In Science and Hypothesis (1902) he even mentioned "forth geometry" of space, in addition to elliptic, hyperbolic and Euclidean ones, and pointed out that in it lines can be perpendicular to themselves. But according to Weinstein's Poincaré's Dynamics of the Electron, in his famous 1904-06 papers "Poincaré did not associate this quadratic form with propagation of light in order to define a null interval like Einstein or a metric like Minkowski". It took Minkowski to take that extra step of treating time as space.
Yaglom's Felix Klein and Sophus Lie gives many historical details on late 19th century geometry and its relation to relativity with references to the original sources.
Minkowski space time was considered by mathematicians before Einstein and before Minkowski. Of course the name "space-time" was not used. The reasons were purely mathematical, not physical. The most important application was the Klein model of the hyperbolic geometry (non-Eucludean geometry of Bolyai and Lobachevski). More presicely, Klein considered the metric $$ds^2=-dx_0^2+dx_1^2+\ldots+dx_n^2$$ in the $n+1$ space. This metric, restricted to the upper portion of the hyperboloid $$-x_0^2+x_1^2+\ldots+x_n^2=-1$$ is the Klein model of the hyperbolic geometry. In physics when $n=3$ the space with metric $-ds^2$ is the Minkowski space-time. So Klein's model of a hyperblic space is a hypersurface in the Minkowski space time, and this is how it was introduced.
When I wrote that the reasons were pure mathematical, I did not take into account that Lobachevski and Gauss admitted the possibility that hyperbolic geometry holds in the real physical space. Both of them realized that no experiment really tells us that the geometry of our physical space is Euclidean. An experiment can tell us the opposite: you can never be sure that the sum of the angles of a triange exactly equals 180 degrees but an experiment can show that it is less, if it is less indeed). There are indication that Gauss really tried this sort of experiment (measuring angles of a really big triangle between mountain tops). But apparently connections with physics were not among Klein's motivations.
Complementing Conifold's answer, it might perhaps be instructive to quote from Minkowski's presentation Raum und Zeit at the 80th Congress of German Natural Scientists in Cologne on the 21st of September 1908, a short few months before his own death. In this speech he makes it clear the physical origin of his eponymous spacetime:
Mein Herren! Die Anschauungen über Raum und Zeit, die ich Ihnen entwickeln möchte, sind auf experimentell-physikalischem Boden erwachsen. Darin liegt ihre Stärke. Ihre Tendenz ist eine radikale. Von Stund′ an sollen Raum für sich und Zeit für sich völlig zu Schatten herabsinken und nur noch eine Art Union der beiden soll Selbständigkeit bewahren.
or in translation
Gentlemen! The views of space and time that I wish to lay before you have sprung from the soil of experimental physics and therein lies their strength. They are radical. Henceforth, space by itself, and time by itself, are doomed to fade away into mere shadows, and only a kind of union of both will retain an independent reality.