Italian Game Response As Black How do I respond to the Italian Game here?

[FEN ""]
1. e4 e5
2. Nf3 Nc6
3. Bc4 Nf6
4. Ng5 d6 (I kind of got lost here)
5. Nxf7 1-0


What should I have done against this as Black?  For reference me and my opponent are rated about 1000-1200.

I blundered bad, but without taking my queen out early I can't see another line.

I've seen some stuff that suggests giving a pawn for other stuff, but I really would like to maintain material equality in the opening without extremely losing initiative / space / development.
4.Ng5 is a provocative move, threatening to take on f7.

The main line is 4...d5, and after 5.exd5 the best move might be 5...Na5. After 6. Bb5+ c6 7. dxc6 bxc6 Black has sacrificed a pawn but has gained a slight lead in development. If instead you play 5...Nxd5, White will often play 6. Nxf7 Kxf7 7. Qf3+ Ke6, known as the Fried Liver. White has a very good attack despite being down material. At your level, White is probably wanting and expecting the Fried Liver when he plays Ng5, so I wouldn't give it to him.

The other common response is 4...Bc5, known as the Traxler Counterattack. Black is allowing White to take on f7 but is trying to get his own attack on f2. These games can get wild.

None of these really fit your criteria; they involve sacrifices by one side or the other. If you prefer material equality, I suggest you avoid this line altogether by playing 3...Bc5, going into the Giuoco Piano instead of the Two Knights as your response to the Italian. White cannot then play 4.Ng5 because you could take the knight with your queen.

[FEN ""]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 (3... Bc5 {Giuoco Piano}) 4. Ng5 d5 (4... Bc5 {Traxler}) 5. exd5 Na5 (5... Nxd5 6. Nxf7 Kxf7 7. Qf3+ Ke6 {Fried Liver}) 6. Bb5+ c6 7. dxc6 bxc6 *