Langer's knock, which included 19 fours and five sixes, saw him take 65 runs from 24 balls from leg-spinner MacGill on the Western Australian Cricket Association Ground (WACA)wicket, which is better known for favouring pace bowling.
In one over he belted MacGill for 22 with three consecutive sixes over long-on.
He reached his century in the opening session on Friday, taking just 21 balls to move from 50 to 100.
For MacGill, celebrating his 34th birthday, the result was a disaster and he finished with 0-133 off 23 overs.
In reply to the NSW first innings total of 305, Western Australia was 456 for six with Adam Voges on 74 and Peter Worthington, on 13, the not out batsmen.
Scores:(day two): New South Wales 305 (D Thornley 100, P Jaques 50; B Williams 4-53, A Voges 2-43) Vs Western Australia 456 for six (J Langer 134, M Goodwin 86; N Bracken 2-64, S Clark 3-118)