If $X$ is locally compactly generated then $X$ is compactly generated because every locally compact space is compactly generated.
So given $f:X \to Y$ a map such that $f\circ i$ is continuous for every compact $i:K \to X$, then it follows that for every locally compact $j:Q \to X$ one can test the continuity of $f \circ j$ on all compact $K \to Q \to X$, hence $f \circ j$ is continuous, and as $X$ is locally compactly generated it follows that $f$ is continuous.
The problem is actually with the converse: If "compact" means "compact hausdorff" then every compact space is locally compact so the converse hold trivially, but this fails if compact means quasi-compact.
Indeed let $X$ be a non-compactly generated space (in particular it is not locally compactly generated).
Let $X^*$ be the space obtained by adding one point $*$ to $X$, with the open subset of $X^*$ being the open subset of $X$, together with $X^*$ itself.
$X^*$ is quasi-compact because a collection of open is covering if and only if it contains $X^*$ itself. But $X^*$ is not locally compactly generated: Given a map $F:X \to Y$ which is continuous when restricted to any (locally) compact space but continuous. Then we can show that the induced map $X^* \to Y^*$ will be continuous when restricted to any locally compact space, but not continuous itself, so $X^*$ is compact but not locally compactly generated.
In the last claim, I'm using that given a continuous map $j: Q \to X^*$ the preimage $Q' = j^*X$ is a locally compact space with a map to $X$ and the map $Q \to X^*$ can be factored as $Q \to Q'^* \to X^*$ with $(Q')^*$ being locally compact.