Pentagon Wilson loop with Lagrangian insertion at two loops in N = 4 super Yang-Mills theory