Yes, the forces due to the spring on the two blocks are equal and opposite.But it's not an example of Newton's third law because there are three objects (2 blocks + 1 spring). Spring force on one block and force by the same block on the spring is an action-reaction pair.