Newcastle benefitted from a controversial free kick awarded for a foul by Ola Aina on Anthony Gordon as they came back to beat Forest.