Ennis clinched victory minutes before Farah took to the track to prepare for his 10,000m final.
Farah told BBC Sport: "I saw Jess with a flag and knew she must have won gold and I just felt I had to win."
"As I came through the tunnel, people were just shouting 'Go Mo!' and the atmosphere was something else. I was really buzzing, it was like someone had just given me 10 cups of coffee, I was just pumped up so much."
Farah and Ennis joined long jump winner Greg Rutherford to complete a hat-trick of gold medals for Team GB in a memorable night of athletics at the Olympic Stadium.