Personally, I prefer Inclusion-Exclusion here. See this article for an
introduction to Inclusion-Exclusion.
Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.
Let $~S~$ denote the set of all 1-1 permutations, ignoring the constraints on $~f(1), \cdots, f(5).~$
For $~k \in \{1,2,\cdots,5\},~$ let $~S_k~$ denote the subset of $~S~$ where the constraint on $~f(k)~$ is violated.
Then, the desired computation is
$$| ~S ~| - | ~S_1 \cup S_2 \cup \cdots \cup S_5 ~|. \tag1 $$
Let $~T_0~$ denote $~| ~S ~|.~$
For $~r \in \{1,2,\cdots,5\},~$
let $~T_r~$ denote
$~\displaystyle \sum_{1 \leq i_1 < i_2 < \cdots < i_r \leq 5} | ~S_{i_1} \cap S_{i_1} \cap S_{i_2} \cap \cdots \cap S_{i_r} ~|.$
That is, $~T_r~$ denotes the sum of $~\displaystyle \binom{5}{r}~$ terms.
Then, by Inclusion-Exclusion theory, the computation in (1) above is equivalent to
$$\sum_{r=0}^5 (-1)^r T_r.$$
Therefore, the problem reduces to computing
$~T_r ~: r \in \{0,1,2,\cdots,5\}.$
$\underline{\text{Computation of} ~T_0}$
There are $~6~$ choices for $~f(1),~$ then $~5~$ choices for $~f(2),~$ and so forth.
So,
$$T_0 = 6!.$$
$\underline{\text{Computation of} ~T_1}$
To compute $~| ~S_1~|,~$ consider that there are $~2~$ choices for $~f(1),~$ and then $~5!~$ choices for the remaining domain elements.
To compute $~| ~S_k ~| ~: k > 1,~$ consider that there is $~1~$ choice for $~f(k),~$ and then $~5!~$ choices for the remaining domain elements.
Therefore,
$$T_1 = (2 + 4) \times 5! = 6!.$$
$\underline{\text{Computation of} ~T_r ~: ~r \geq 2}$
Clearly, $~T_5 = 2,~$ since $~f(1)~$ has $~2~$ choices. The remainder of this section assumes that $~2 \leq r \leq 4.$
I will use the variables:
$T_{ra}~$ may be represented by
$$| ~S_1 \cap S_2 \cap \cdots \cap S_r ~|. $$
There will be $~\displaystyle \binom{4}{r-1}~$ such terms, and each term will equal
$$2 \times (6-r)!.$$
Therefore,
$$T_{ra} = \binom{4}{r-1} \times 2 \times (6-r)!.$$
$T_{rb}~$ may be represented by
$$| ~S_2 \cap S_2 \cap S_{r+1} ~|. \tag1 $$
There will be $~\displaystyle \binom{4}{r}~$ such terms, and each term will equal
$$(6-r)!.$$
Therefore,
$$T_{rb} = \binom{4}{r} \times (6-r)!.$$
So,
$$T_r = T_{ra} + T_{rb}$$
$$= (6-r)! \times \left\{ ~\binom{4}{r} + \left[ ~2 \times \binom{4}{r-1} ~\right] ~\right\}.$$
$\underline{\text{Final Computation}}$
The computation is
$$\sum_{r=0}^5 (-1)^r T_r$$
where