How should white continue after 5...Qf6 in the Scotch Game? I have been playing the Scotch main line every chance I get.  I have had a pretty good success rate with it, but I feel this is due to the my opponent not having a complete understanding of the Scotch.  My play usually goes something like this:

 [fen ""]

 1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4


After this, I rarely encounter the classical move 4...Bc5.  Most of the time, black will play 5...Nxd4 followed by 6. Qxd4 and I usually find myself in a pretty good position here.  However, so far I have never encountered the moves 4...Bc5, 5. Nxc6 Qf6 (threating mate)

It is this position that gives me most trouble, I know that my knight on c6 is lost because of the mate threat, so what is white's best move(s) if play continues with 5...Qf6.  I have found it very difficult for white to recover from this, especially since black has more development
First, I'd note that the most popular move after 4... Bc5 (according to the game databases of both Chess Tempo and Chess Games) is actually 5. Be3, and I suppose there's an argument to be made that it's both the more ambitious and the more principled move because it attempts to maintain control and/or occupation of the d4 square rather than immediately ceding it. In those main lines, Black is generally seeking to play a freeing ...d5 pawn break, when White's center is either liquidated or White is forced to push his pawn to e5 (typically supported by a pawn on f4), creating a structure where Black must blockade and aim to attack the head of the White f4-e5 chain while White seeks to bolster and ultimately advance it.

It's typical of most variations in the Scotch that Black gets a slight lead in development in exchange for White's superior pawn structure and has to use piece play (combined with timely pawn breaks like ...d5) to avoid the dreaded "Scotch ending" where White has a mobile king-side pawn majority while Black's queen-side pawns can be blockaded (due to the pawn doubling that normally takes place on the c-file in many lines).

In the line that you specifically refer to, the only two common and respectable continuations are either 6. Qd2 or 6. Qf3. (I have seen 6. Qe2 played, presumably with the idea of not blocking the dark-square bishop and intending on castling queen-side, but it's comparatively rare and, statistically, its practical success rate looks abysmal.) Of these, I've always preferred 6. Qf3, precisely because it doesn't impede White's development in the way that 6. Qd2 does by blocking the dark-square bishop.

In those variations, if Black does capture on f3 (which he almost always does relatively quickly, except in the lines with 6... Qxc6, which are the least common), White's pawn structure is not as compromised as it might superficially appear after the obligatory g-pawn recapture, and in fact gives White a solid central presence and open files and diagonals for his pieces. Those lines lead to relatively standard endgames where the dark-square bishops also normally get traded very quickly and White seems to do well. 6... Qxc6, which is rare, may be a good reply, where Black again aims for a ...d5 pawn break and extremely symmetrical positions arise in which piece play dominates and major strategic themes don't particularly present themselves with any force or consistency.

If none of this sounds appealing, the only other (semi-)respectable way to play the Scotch is as a gambit line with 4. Bc4, appropriately but boringly called the "Scotch Gambit." Notably, this was recommended in the book Chess Openings For White, Explained. Unfortunately, none of the major lines are particularly forcing, and if Black is reasonably familiar with classical open games, he can transpose into lines of either the Giuoco Piano or the Two Knights Defense where he returns the pawn and easily equalizes (in fact, I'd say Black has a more pleasant position in the best of the Two Knights Defense lines than White does).