Starting position
The moves 1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.d4 exd4 5.Ng5 — the Rosentreter Gambit: White gives up the pawn on d4, and the knight and the bishop hit f7, which only the king defends. In essence this is the Scotch Gambit, Sarratt Variation.
The opponent's mistake
5...Ne5? looks strong: the knight attacks the bishop on c4 and covers f7. But now only the bishop on c5 defends the pawn on d4, and nothing defends the bishop itself.
How the trap works
White takes on f7 anyway: 6.Nxf7 Nxf7 7.Bxf7+ Kxf7. A knight and a bishop are given for a knight and a pawn, but Black's king has lost the right to castle. 8.Qh5+ — check, and the queen attacks the bishop on c5. After 8...g6 9.Qxc5 the queen takes the bishop, and after 9...d6 10.Qxd4 the pawn on d4 as well. On 10...Nf6 the bishop comes to 11.Bg5 and pins the knight to the queen.
1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.d4 exd4 5.Ng5 Ne5 6.Nxf7 Nxf7 7.Bxf7+ Kxf7 8.Qh5+ g6 9.Qxc5 d6 10.Qxd4 Nf6 11.Bg5
Result
White is a pawn up with a big advantage, and Black's king can no longer castle.
How to defend (as Black)
Play 5...Nh6: the knight covers f7, and the knight on c6 still defends the pawn on d4. White can still give the knight and the bishop on f7 and win the bishop with a queen check, but then material is equal and so is the position.